Custom Datagrid Tamplate column
Hello,
I have datagrid with tamplate column. I bind dataset to it, with column named "Type".
I need to do this:
If type = "textbox" then put textbox in row, if Listbox, then listbox and so on.
Other logic I'll create my self.
I do not know how dynamicaly add controls to datagrid when binding.
Any ideas?
Re: Custom Datagrid Tamplate column
You can always add a control in the ItemDataBound event, but you'll need to explain the logic of
type="textbox"
first.
Re: Custom Datagrid Tamplate column
If row in db table have string "textbox" then I add textbox control to datagrid word, if string "listbox" then listbox and so on.