Posts

Showing posts from November, 2022

Syncfusion - GridControl - Sync Scrolling of the Two Gridcontrols

Image
Syncfusion - GridControl  -  Sync Scrolling of the Two Gridcontrols  Note: - With this when first is scrolling horizontally below grid will also screen as per the column visible Note : Example above has two GridControl one user interactive and other is Disable to show            summary totals for grid above. To avoid Label driver Totals.   Example show sync between to grid on Horizontal scroll of grid1   Code : Form Load Event   GridControl2.HScrollBehavior = GridScrollbarMode.Shared GridControl2.UseSharedScrollBars = True GridControl2.HScrollBar.InnerScrollBar =GridControl1.HScrollBar.InnerScrollBar   ‘This Required in case when Vertical Scroll need to be synced GridControl2.VScrollBehavior = GridScrollbarMode.Shared GridControl2.VScrollBar.InnerScrollBar =GridControl1.VScrollBar.InnerScrollBar   Note:- for above example Vertical Scrollbasr Sync in not required

Syncfusion - GridControl - How to Access Top Row index Visible on screen

Image
  TopRowIndex : - Property of GridControl Gets or sets the column index of the left column. Scrolls the grid when changed.   Code TextBox1.Text = GridControl1.TopRowIndex

Syncfusion GridControl - Column Merge in Design Time (Covered Cell)

Image
  1. Goto  Property (F4). Look for Covered Ranges   2 . Click on Button To open Covered Range Definition Window 3. Click on Drop Down . This open Range Defination for Covered Range.  (Look for Range definition in ARC Syncfusion GridControl Help ) 4.  Once Range is Defined . Click OK and Close Window with OK  5 . Check out grid it has Covered the Range of A-B-C  

Syncfusion - GridControl - Syncfusion

Image
MonthCalendar Working in gridControl MonthCalendar CellType Is not supported by Our DLL. We have MaskedEdit CellType for DateControl. So to have MonthCalendar Feature This how you Can Work Out. Place MaskedEdit Column and Second Column for MonthCalendar Control. As Shown in Images Private   Sub  mc_DateChanged(sender As   Object , e As   DateRangeEventArgs )         GridControl1.Item(GridControl1.CurrentCell.RowIndex, 1).CellValue = CType (sender, MonthCalendar ).SelectionStart.ToString( "dd/MM/yy" )         'Console.WriteLine("DateChanged fired")     End   Sub       Private   Sub  GridControl1_CurrentCellAcceptedChanges(sender As   Object , e As  System.ComponentModel. CancelEventArgs ) Handles  GridControl1.CurrentCellAcceptedChanges         If  GridControl1.CurrentCell.ColIndex = 1 Then ...

Syncfusion - GridControl - Auto Size property for Cell : This will Auto Fit Content of Cell . Will Resize Row height as per the content of Cell.

Image
  Auto Size property for Cell : This will Auto Fit Content of Cell . Will Resize Row height as per the content of Cell.

Syncfusion - GridControl - Hide Grid Column Using Array

Syncfusion - GridControl  -  Hide Grid Column Using Array   Dim x() As GridColHidden = {New GridColHidden(2), New GridColHidden(4), New GridColHidden(6), New GridColHidden(5)} GridControl1.ColHiddenEntries.AddRange(x) Above Code will hide Column 2,4,6 and 5 No Looping is Required for Hiding the 

MVC.net - How to use the ActionLink to a load view

How to use the ActionLink to a load view @Html.ActionLink("Link Text", "ActionName",           new { controller = "MyController", id = 1 },           new { @class = "my-class" }) Link Text is compulsary. if not provided it will raise exceptation. to overcome this  instead of space use : press from keyboard between "" alt+255   @Html.ActionLink(" ", "EntryModule", new { controller = "Engineer", id = 0 },new { @class = "btn fa fa-plus-square fa-3x" }) Sending Addtional Parameter to Controller Action. @Html.ActionLink(" ", "EntryModule", new { controller = "Engineer", id = item.ID , CalledAction="E" }, new { @class = "btn fa fa-pencil-square-o fa-2x" }) @Html.ActionLink(" ", "EntryModule", new { controller = "Engineer", id = item.ID, CalledAction = "D" }, new { @class = "btn fa fa-trash fa-2x" }) Metho...

MVC.net - Set Tab Index To Control

 Set Tab Index To Control  @Html.TextBox("Login", "", New With {.class = "textbox", .tabindex = 1}) @Html.TextBox("Password", "", New With {.class = "textbox", .tabindex = 2})

MVC Page Refresh After Ajax Call

MVC Page Refresh After Ajax Call How to Send URL From Controller to Ajax [HttpPost] {     var redirectUrl = new UrlHelper(Request.RequestContext).Action("Index", "user", new { } );      try     {         // perform some action     }     catch (Exception)     {         return Json(new { Url = redirectUrl, status = "Error" });     }                       return Json(new { Url = redirectUrl, status ="OK" }); } var UserModel = {     // initialise model fields };   $.ajax({     url: "@Url.Content("~/user/cancel")",     data: JSON.stringify(UserModel),     type: 'POST',     contentType: 'application/json; charset=utf-8',     success: function (data) {         if (data.status === 'OK') {             window.locatio...

Get Max and Min from Array - VB.net

Get Max and Min from Array  Dim data() As Int16 = {1, 2, 3, 5, 6, 7, 3}  Dim C As Integer = data.Max()  Dim D As Integer = data.Min() Distinct of Array Dim data() As Int16 = {1, 2, 3, 5, 6, 7, 3} Dim M() As Int16 = data.Distinct().ToArray() Sum With Array Dim data() As Int16 = {1, 2, 3} Dim X As Int32 = data.Sum(Function(y) y) ' This will Return 6 

Get Running total from Array - VB.net

Get Running total from Array         Dim data() As Int16 = {1, 2, 3, 5, 6, 7, 3}         Dim U As Integer = data.Aggregate(0, Function(a, b) a + b)

Panel Vs GroupBox

 Panel Vs GroupBox Panel has Scrollbar  Groupbox Doesn't Have Panel Provide TabStop Feature Group Box Doesn't GroupBox Border Can't be removed Panel Border are Optional Groupbox Provide Option to have Caption  Panel Doesn't

Error 6 Interop type 'CommonDialogClass' cannot be embedded. Use the applicable interface instead

Error 6 Interop type 'CommonDialogClass' cannot be embedded. Use the applicable interface instead This happen when you use CommonDialogClass in your Project. To resolve the issue Follow the below steps. Reference -> WIA -> f4 - >  Embed Interop Type  = False 

Why PADL and PADR Not Working in Textbox and Other Control And same Working in Console Window Formatting text with padding does not line up in C#

Image
  Why PADL   and PADR Not Working in Textbox and Other Control And same Working in Console Window Formatting text with padding does not line up in C#   Grid                                                                                                        Label Control   Your problem is kerning [Each Character are of different Size and Width take are Different]. Change your text to a monospaced font ( where all the characters are the same width ) or use ...

Conditional Property Serialization Property To JSON - VB.net

Conditional Property Serialization Json.NET has the ability to conditionally serialize properties by placing a ShouldSerialize method on a class. This functionality is similar to the  XmlSerializer ShouldSerialize feature. ShouldSerialize To conditionally serialize a property, add a method that returns boolean with the same name as the property and then prefix the method name with ShouldSerialize. The result of the method determines whether the property is serialized. If the method returns true then the property will be  serialized, if it returns false then the property will be skipped. Live Code We need to exclude hsn and Doc_issue when they are nothing in runtime (Same is done Nothing when not to be Serialized) Public Structure Json_Parent         Public Property gstin As String         Public Property fp As String         Public Property version As String         Public Property hash As String ...

How to Download File using HTTP - VB.net

How to Download File using HTTP - VB.net Private Sub DownloadFile()   Dim strURL As String = IO.Path.Combine(txtUpdateURL.Text, UpdateZipFileName).Replace("\", "/")                 strDownloadFilePath = IO.Path.Combine(txtUpdateDownloadPath.Text, UpdateZipFileName)                 If File.Exists(strDownloadFilePath) = True Then                     File.Delete(strDownloadFilePath)  ' ZIp File                                     System.Threading.Thread.Sleep(100)                 End If                 ServicePointManager.ServerCertificateValidationCallback = AddressOf AcceptAllCertifications                 ServicePointManager.SecurityProto...

Syncfusion - GridControl - How to set the Supertooltip for the cells on Mouse move

Syncfusion - GridControl  -  How to set the Supertooltip for the cells on Mouse move  Below is the code. Private Sub gridControl1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Dim superToolTip1 As New SuperToolTip()   Dim row, col As Integer   Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell     If Me.gridControl1.PointToRowCol(New Point(e.X, e.Y), row, col) AndAlso (col <> hooverCol OrElse row <> hooverRow) Then                 hooverCol = col                 hooverRow = row                 Dim rect As Rectangle = Me.gridControl1.GetCellRenderer(row, col).GetCellBoundsCore(row, col, False)                 Dim screenPoint As Point = Me.gridControl1.PointToScreen(New Point(rect.Left, rect.Top))                 Dim...

Syncfusion - GridControl - Show Right Click Menu on Selected Range

Image
Selection of range and Right Click. Normally if you Select a Range in Grid and Right Click on that Range the Selected Range is Changed to Cell on which Right Click is Done. GridControl1.Model.Options.SelectCellsMouseButtonsMask = Windows.Forms.MouseButtons.Left Menu Strip item Event to Get Range of Selected Range when Right Clicked Private Sub OneToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OneToolStripMenuItem.Click         Dim intStartColindex As Integer = ArcGridControl1.Selections.Ranges.ActiveRange.Left         Dim intStartRowindex As Integer = ArcGridControl1.Selections.Ranges.ActiveRange.Top         Dim intEndRowindex As Integer = ArcGridControl1.Selections.Ranges.ActiveRange.Bottom         Dim intEndColIndex As Integer = ArcGridControl1.Selections.Ranges.ActiveRange.Right       // This will return the selected Range if you need this range to be used for updating va...

Syncfusion - GridControl - Prevent removing of selected range when used mouse right click

Syncfusion - GridControl How to Prevent removing of selected range when used mouse right click The selection will be cleared when perform the right click on the selected range of cells. It can be restricted from clearing the selection using the SelectCellsMouseButtonsMask property. This will be used to display the context menu for performing the actions on the selected range of cells. //Restrict the clearing of selection using the mouse right click. this.gridControl1.SelectCellsMouseButtonsMask = System.Windows.Forms.MouseButtons.Left;

Syncfusion - GridControl - Events

Syncfusion GridControl - Events  CurrentCellAcceptedChanges - Occurs when the grid accepts changes made to active current cell. CurrentCellMoved - Occurs when current cell is moved to new position. CurrentCellMoving - Occurs when current cell is about to be moved to a new position. CurrentCellMoveFailed - Occurs when current cell movement to a new position fails. CurrentCellActivating - Occurs before the grid activates the specified cell as current cell. CurrentCellActivated - Occurs after the grid activates the specified cell as current cell. CurrentCellActivateFailed - Occurs after the grid fails to activate a specific cell as current cell. CurrentCellDeleting - Occurs when the user presses Delete key on an active current cell. CurrentCellStartEditing - Occurs before the current cell switches into editing mode. CurrentCellChanging - Occurs when the user wants to modify contents of the current cell. CurrentCellChanged - Occurs when the user changes contents of the current cell. Cu...

Syncfusion - GridControl - Remove Zero and Show Empty Cell

Image
Syncfusion GridControl - Suppress Zero of all Currency Cell in GridControl This Can be done in GridControl event  DrawCellDisplayText Below is the Code for the same Private Sub grdReport_DrawCellDisplayText(sender As Object, e As GridDrawCellDisplayTextEventArgs) Handles grdReport.DrawCellDisplayText          Dim col As Integer = e.Style.CellIdentity.ColIndex          If e.Style.CellIdentity.RowIndex > 0 Then                  If e.DisplayText = "0.000" OrElse e.DisplayText = "0" Then                            e.DisplayText = ""                             e.Cancel = True           End If End Sub Note : Above code will remove 0.000 or 0 with Empty string. in the gridControl. Before the event After the Event

Syncfusion - GridControl - Currency Cell - Show Negative Sign

Syncfusion - GridControl   How to show negative sign in the Currency Cell ? In Property Page Select - Currency Column in Designer - Currency Edit - Set Negative Pattern to 1 This will represent the Numeric value as -99,99,99 If the format is required with (99,999) Than the format has to be changed to .   grdReport.Item(1, 2).Format = "###.##;(###.##)" Output. -2 will look as (2)

Syncfusion - GridControl - How to have with leading Zero in the FormulaCell

Syncfusion - GridControl  How to have with leading Zero  in the FormulaCell  ? Code :  grdReport.Item(CurrentRow, intCol).Format = "##,###0.000"c Note : For Formatting FormulaCell with leading Zero when it .999 TO 0.999

An Attempt was made to Load an Assembly from a Network Locaiton - Error

Image
An Attempt was made to load assembly from a network Location- are you face this error while running your Win.net application from Client PC. This happen in case when you are running Application Placed on Server and Shortcut of the same is placed on Client Desktop and Same is been executed. Error on the Client PC To Resolve this below are the steps to be followed Place the below Setting in the Config File ([Application].exe.Config) File will be found in the Application Directory <configuration>      <runtime>          <loadFromRemoteSources enabled = "true" />      </runtime>   </configuration> . To be Precise