We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

mulitcolumn combox column existence detection

for a multicolumn combox, i tried to use the following to test wheather the column named "ActiveStatus" existing or not withion PrepareView event handler,

--> mccb.Model.NameToColIndex("ActiveStatus");

somehow, it give me uncatchable exception error "Invalid Range 'activestatus'" if the datasource (say, datatable) really doesn't have such column. I am expecting just returning me -1, isntead of always get exception at least.

how can i detect the column's existing in the combox? and what do i need to do ? or is there a better way to test if the column exists ?

david


3 Replies

JJ Jisha Joy Syncfusion Team October 7, 2008 12:25 PM UTC

Hi david,


Could you please let me know which Syncfusion control you are referring?

If you are referring gridListControl, The method this.gridListControl1.Grid.Model.NameToColIndex will return -1, if the specified column name id not existing. Please refer the sample to illustrates this:

http://www.syncfusion.com/support/user/uploads/GListControlEvent_a8efb08d.zip

Regards,
Jisha






DC David Cui October 7, 2008 01:53 PM UTC


I mean Multi-Column Combox control.
Even for the example you gave me, i saw a lot of exceptions happen (see below). I am asking Is there any efficient Name2Index to check column's exisitence? otherwise, it is every expensive by your underlying check exception. thx.

catched at Syncfusion.Windows.Forms.Grid.GridRangeInfo.Parse(String parseText) in :line 0
System.FormatException: Invalid Range: DD
at Syncfusion.Windows.Forms.Grid.GridRangeInfo.ParsePart(String parseText)
at Syncfusion.Windows.Forms.Grid.GridRangeInfo.Parse(String parseText)
System.FormatException: Invalid Range: DD
at Syncfusion.Windows.Forms.Grid.GridRangeInfo.Parse(String parseText)
at Syncfusion.Windows.Forms.Grid.GridModel.NameToColIndex(String name)
catched at Syncfusion.Windows.Forms.Grid.GridModel.NameToColIndex(String name) in :line 0
-1



>Hi david,


Could you please let me know which Syncfusion control you are referring?

If you are referring gridListControl, The method this.gridListControl1.Grid.Model.NameToColIndex will return -1, if the specified column name id not existing. Please refer the sample to illustrates this:

http://www.syncfusion.com/support/user/uploads/GListControlEvent_a8efb08d.zip

Regards,
Jisha








JJ Jisha Joy Syncfusion Team October 16, 2008 09:01 AM UTC

Hi David,


Sorry for the delay in getting back to this issue.

I was able to see the issue. We suspect this issue to be a defect. Please create a Direct trac incident to follow up mentioning the forum title as subject.

Regards,
Jisha


Loader.
Live Chat Icon For mobile
Up arrow icon