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
190
XamWebGrid Column layout
posted

Hi,

I was able to create a hierarchy webgrid (using ObservableCollection) and would like to create the column layout dynamically. 

here is my code:

 

 

 

e.ColumnLayout.Columns.Add(

new TextColumn(){

HeaderText =

"TestId",

Key = "Id",

Width =

new ColumnWidth(20, false));

But it gave me this error:

The following key(s) do not correspond with the DataSource: "Id".
If you'd like to add additional columns, please use the TemplateColumn type.


Using the ColumnLayoutAssigned event, how do I get the key of each column for each band - parent and child?
Thanks for your help

Parents
  • 40030
    Offline posted

    Hi, 

    So what exactly are you trying to do?

    The ColumnLayoutAssigned event is mainly for overriding the ColumnLayout that is going to be used, generally this would be if you have AutoGenerateColumns on. 

    If you're just trying to define ColumnLayouts for different levels, then you can use the ColumnLayouts property on the XamWebGrid, which allows you define ColumnLayouts globally. 

    Check out the following article which describes in detail the various ways to define a ColumnLayout:

    http://help.infragistics.com/Help/NetAdvantage/Silverlight/2009.1/CLR3.5/html/SL_xamWebGrid_Define_Column_Layout.html

    -SteveZ

Reply Children