Hi,
I have a xamdatagrid with few columns, I have put ToggleButton in one column header , when you click on the ToggleButton, it expands and It shows 6 columns which were there in Collapsed state. they become visible. similarly when you click it once again, 6 expanded columns are collapsed again.
Column which has toggle button on; it is marked bold in below xaml,
and is displayed with rowspan=2 & row=0, columns with width=200 & 20 are always displayed when 6 columns are expanded they are displayed in last, when 6 columns are collapsed then these 2 columns are displayed after the column which is marked in bold.
<igDP:FieldLayoutSettings.DataRecordCellAreaGridTemplate
>
="gridDataRecordCellAreaGridTemplate">
="80"/>
="250"/>
="50"/>
="200"/>
="20"/>
Now, my problem is I want to set Column Width for each and every column, so i used DataRecordCellAreaGridTemplate, i have put ComunDefinitions for all columns, but when 6 columns are collapsed, how can I maintain the same column width i.e. 200 & 20. what happens it these 2 column are displayed with width = 50!
Please give me some solution, how can we handle the column width, some style or my guess is we can do that in code behind, i have a function named "ToggleButtonPressed" which does this job of expanding & collapsing, we could add some code there, but i dont know how to access DataRecordCellAreaGridTemplate in code behind.
Hello,
You can access that Grid element using the Infragistics.Utilities.GetAncestorFromName/ GetDescendantFromName methods as you have specified a name already. Another way to do this, without the DataRecordCellAreaGridTemplate is by setting CellWidth and LabelWidth properties of the Fields in the FieldLayout.
Thanks Alex, You are simply great!