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
980
Auto Generated Columns styling and value trimming
posted

Hello,

I use auto generating of columnes in wdg. In pageload i bind the grid to the dataview. How do I set css for those columns? I tried to do that in databound event, but it doesn't find the columns. One more point - I need to trim the string in the column. In uwg it was possible like this

protected void UltraWebGrid1_InitializeRow(object sender, RowEventArgs e)
{
       e.Row.Cells[0].Value = e.Row.Cells[0].Value.ToString().TrimEnd();
}

But in wdg it's allowed only for unbound columnes. Any help?

Parents
No Data
Reply
  • 980
    posted

    Ok, as for auto generated columns i found useful but mostly discouraging information here - http://es.infragistics.com/community/forums/t/51770.aspx . 

    Summarizing it - it's impossible to access autogeneratedcolumns directly (THOUGH IT WOULD BE GREAT - LIKE WE CAN ACCESS BOUND AND BOUND COLUMNS, MAKE ANOTHER PROPERTY - AUTOGENERATEDCOLUMNS).

    But it's possible to access it from the rows like Rows[0].Items[i].Column (thanks to Werner). However, the tricky point is that it's possible not from all event handlers. For example from data bound it yet didn't see the new columns.

    The best solution I found so far - and the working one - to init DataSource for grid and after that to set properties for Columns.

    But the issue about changing values is still unresolved. Perhaps it's possible to use value format property, I'm not yet sure.

Children