Home Forums WinForms controls Xceed Grid for WinForms Problems DirectCasting to Xceed.Grid.GridControl Reply To: Problems DirectCasting to Xceed.Grid.GridControl

User (Old forums)
Member
Post count: 23064

Hi Tommy,

Rather than pass anything to the usercontrol, I have created a property that contains the string name of the relevant Xceed Grid. For this property, you actaully select the relevant name of the Xceed grid from a drop down list in the form designer.

I found the code I was after to create this drop down list of relevant controls on a website and the end result is a list of string names rather than of the specific control type..

So in my usercontrol, I just compare this property name against all the controls on the current form to find the match. Coding this way means everything is in the usercontrol. When it comes to creating an instance of the usercontrol I simply paste it into the form and set the property that indicates which Xceed Grid the instance of the usercontrol is relevant to.

Come to think of it, I think I am better off just making the property of type Xceed Grid and getting the programmers to have to type it in, rather than select it from a drop down list.

I would still like to know how to cast an instance of a Control to an Xceed Grid.

Mac

Imported from legacy forums. Posted by Dominic (had 323 views)