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

GridDataControl

I have two issues:
1-How to assign a dynamic resource from code-behind for visible columns ?i cannot find the appropriate method like SetResourceReference() for example

2-How to make bindings from code-behind for visible columns different dependency properties ? i cannot find the appropriate method like SetBinding() for example

Thank You


1 Reply

RG Rajasekar G Syncfusion Team June 6, 2013 09:41 AM UTC

Hi Abdalla,

 

Thank you for your interest in Syncfusion products.

 

Query

Syncfusion Comments

1-How to assign a dynamic resource from code-behind for visible columns ?i cannot find the appropriate method like SetResourceReference() for example

We are not able to use SetResourceReference() to visible column but you can  apply style to visible column in code behind using resource key like below code snippet.

 

Code snippet[C#]:

this.SyncGrid.VisibleColumns["CustomerID"].ColumnStyle = (GridDataColumnStyle)this.Resources["ColumnStyle"];

//Here CustomerID is the MappingName of GridDataVisibleColumn

2-How to make bindings from code-behind for visible columns different dependency properties ? i cannot find the appropriate method like SetBinding() for example

We have analyzed your query and you can bind the HeaderText in code behind as below the code snippet.

Code snippet[C#]:

GridDataVisibleColumn column = new GridDataVisibleColumn();

column.Binding = new Binding("Quantity");

Binding bind = new Binding

{

     ElementName = "Combo",

     Path = new PropertyPath("Text")

};

BindingOperations.SetBinding(column, GridDataVisibleColumn.HeaderTextProperty, bind);

 

We have prepared the sample based on your requirement and please find the sample under the following location.

Sample: Binding.zip

 

 

Please let us know if you have any questions.

 

Regards,

Rajasekar


Loader.
Live Chat Icon For mobile
Up arrow icon