The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Please advise me how to get DataType if we populate ggc from dataset, in order that we can customize text alignment, validate user input in each column of each table? P.S. There are visible columns removed.
VKVinoth Kumar K Syncfusion Team January 30, 2008 10:40 PM UTC
Hi Harry,
Thanks for using Syncfusion Products.
You can get the DataType of each column in GridGrouping Control by using the following code.Please refer to the code given below:
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i <= 4; i++) { GridColumnDescriptor column = this.gridGroupingControl1.TableDescriptor.Columns[i]; Console.WriteLine(column.FieldDescriptor.GetPropertyType()); } }
Please let me know if you have any questions.
Regards, Vinoth
HAharisanFebruary 1, 2008 12:56 PM UTC
Hi Vinoth,
Thanks for your assit, this code works but the problem is that: it got wrong column index reference due if there is any visible column(s) removed.
However I got advise from Haneef to implement this code: Private Sub gridGroupingControl1_TableControlCellClick(ByVal sender As Object, ByVal e As GridTableControlCellClickEventArgs) Dim cm As CurrencyManager = e.TableControl.Table.GetCurrencyManager() Dim dv As System.Data.DataView = cm.List
If Not dv Is Nothing Then Dim col As GridColumnDescriptor = e.TableControl.Table.GetColumnDescriptorAt(e.Inner.RowIndex,e.Inner.ColIndex) If Not col Is Nothing Then Console.WriteLine(col.MappingName) Console.WriteLine( dv.Table.Columns.Contains(col.MappingName) ) End If End If End Sub
The problem is I got InvalidCastException error on this line: Dim dv As System.Data.DataView = cm.List
Please advise me how to fix it?
Thanks, Harry
VKVinoth Kumar K Syncfusion Team February 1, 2008 06:34 PM UTC