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

Indexers in Mapping Names?

Quick question: can I use an indexer in the MappingName property text of a GridDataVisibleColumn? I can get the code to compile and run, and the Visible column is added to the GridDataControl, but there seems to be an issue with the binding at the moment. I just want to know if this is possible so I don't waste time seeking a solution if one doesn't exist.

Example: 

OrderGridDataControl.VisibleColumns.Add(new GridDataVisibleColumn() { HeaderText = "Unit Cost", MappingName = "Unit[0].Cost" });

Thanks in advance,

Will.



8 Replies

KR Kannan R Syncfusion Team January 22, 2013 06:04 AM UTC

Hi Will,

 

Thanks for using Syncfusion products.

 

We have analyzed your query with our sample and please find our response below.

 

We can use an indexer in the MappingName property text of a GridDataVisibleColumn, and for this we need to set VisibleColumnType and Binding property for the particular column. We have prepared sample based on your requirement and it can be downloaded from below location.

 

Sample Location: MappingName.zip

 

Please let us know if you have any queries.

 

Thanks,

Kannan.R



WR Will Rogers January 23, 2013 01:19 PM UTC

This worked. I was previously unaware you could set a Binding in addition to a MappingName on a column. The samples and documentation led me to believe databinding was solely performed through the MappingName property.

Thanks,
Will.


KR Kannan R Syncfusion Team January 24, 2013 05:45 AM UTC

Hi Will,

 

Thanks for your valuable feedback, please let us know if you need any assistance in future.

 

Thanks,

Kannan.R



RW Rainer Worbis December 18, 2013 10:19 AM UTC

Hello,
unfortunately i can't access the sample (get some "AccessDenied" XML back). Can you please make the sample public?
Best regards,
Rainer Worbis


SM Saravanan M Syncfusion Team January 6, 2014 12:37 PM UTC

Hi Rainer,

Sorry for the inconvenienced,

Due to our server failure we lost previous data. We have prepared a sample based on you requirement and you can download it from the below location.

Sample Location: GridDataControlSample_Mappingname.zip

Please let us know if this solution helps you,

Regards,

Saravanan.M



EG Eric Gurney March 25, 2014 06:52 PM UTC

this sample doesn't seem to show the use of an indexer...
Can you please post a solution that does?

Thanks,
Eric



MC Michael Cheng April 11, 2014 12:58 PM UTC

The sample that can be downloaded doesn't show the solution.


FP Farjana Parveen Ayubb Syncfusion Team May 19, 2014 11:53 AM UTC

Hi Michael,

Sorry about the inconvenienced, 

We have prepared a sample by using indexer for both SfDataGrid and GridDataControl and you can download it from the following location

Regards,

Farjana Parveen A

 


Attachment: Mapping_Name_Sample_for_SF_and_GDC_2b54fad9.zip

Loader.
Live Chat Icon For mobile
Up arrow icon