Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Row Selection
posted

Hi

I am having difficulty disabling in cell editing in the whole grid. What I am looking for is behavior similar to an old fashioned list view in the report view (ie click a row anywhere to select the whole row).

I have tried playing with the SelectionTypeRecord, SelectionTypeField and SelectionTypeCell properties but they have no effect. I know this can be achieved on a cell by cell basis but this seems a bit of an inefficient way of doing it. Does anyone know why the aforementioned properties have no effect or am I just missing something?

Also could someone point me at how the change the colour of cell text in C# from the codebehind, I am new to WPF but am I looking at altering a style?

Thanks

Alan

 

Parents
  • 69686
    Verified Answer
    posted

    Hello Alan,

    Actually what you are looking for is CellClickAction property of the FieldSettings object in the XamDataGrid. You can set that to SelectRecord and when you click anywhere in the DataRecord, it will be selected. 

    You can change the color of the cell text in procedural code, throught the correspondant CellValuePresenter. You can use the static get methods of the CellValuePresenter (CellValuePresenter.FromCell(), CellValuePresenter.FromRecordAndField()) and then set its Foreground property.

    If you would like to change that based on a cell value, you can use converters.

    Please follow this link for more information on this (with the difference that the Background instead of Foreground is changed)

    http://community.infragistics.com/forums/p/20644/74574.aspx#74574

    Please let me know if you have any more questions on this.

Reply Children