Hi,
I want to create a Data Template at runtime and add it to the XamGrid HeaderTemplate. I am creating the Columns from codebehind, what I want ist one TextBlock and one Button and One image in the Column Header. and On Click of Button I want to change the Image url. and TextBlock Text. Please let me know how to do this as early as possible.
Thanks
This forum is for the Infragistics xamGrid. It looks like you're using the MS DataGrid.
-SteveZ
Dear,
I already tried like that. But It was throwing an exception "Can't add to the datatemplate".
I will explain the problem in detail below,
This is how I defined the datagrid in xaml file.
When it comes to the code behind file, I have done the following things
datagrid.Columns.Clear();
AddColumn("Id", "AuthorID");
AddColumn("bod", "BOD");
In addcolumn method I am actually creating the datagridtextcolumn and adding it to the dagagrid.
Binding binding = new Binding { Converter = convert, ConverterParameter = name, Mode = BindingMode.TwoWay, Path = new PropertyPath("Data") };
At some part in the code I am assigning datagrid.Itemsource=list
Could you please now tell me where I can add a checkbox.
I am new to silverlight and started learning a week ago . I am wondering of how to do the following task.
I have a datagrid defined in the silverlight XAML file and whose datasource is bound to the observalbecollection at runtime in the code behind file. Now I want to add a checkbox for each row being generated at runtime and when the uses selects this checkbox and I want to make sure that all the columns in theat row have content entered.
You can use commanding for your button's click event.
As for what you should do in the click event, you should have bindings to your TextBlock and Image, so when you update your underlying data model, the image and TextBlock will automatically update.