Is it possible to assign editors to different cells in the code behind at run time?
Do you have a web version of the Infragistics.Win.UltraWinGrid?
Or something similar? I need to replicate a windows forms function on the web.
Specifically I need to iterate through a datagrids rows collection and assign types to cells.
Simliar to
For Each r As Infragistics.Win.UltraWinGrid.UltraGridRow In ParameterGrid.Rows r.Cells("PromptText").Value = r.Cells("ParameterFieldName").Text 'Initialize the ValueList Dim idx As Integer = CInt(r.Cells("CurrentValues").Value) r.Cells("CurrentValues").Value = String.Empty i = CType(valuelistdata(idx), Object()) Dim pType As FieldValueType = CType([Enum].Parse(GetType(FieldValueType), r.Cells("ParameterType").Text), FieldValueType) Select Case pType Case FieldValueType.DateField r.Cells("CurrentValues").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownCalendar r.Cells("CurrentValues").Value = DateTime.Now Case FieldValueType.DateTimeField r.Cells("CurrentValues").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime r.Cells("CurrentValues").Value = DateTime.Now Case FieldValueType.BooleanField r.Cells("CurrentValues").ValueList = m_vBoolean
Hi Daryl,
Thanks for posting the sample project. It will certainly benefit anyone who requires this functionality.
Here is the sample project..
For size reason I removed the ig_res directory.
Thanks for the update. You are absolutely correct. With templated columns you can have different controls inside them like DateTimeEdit controls and TextEdit controls as you suggested. I was looking for a more direct approach like the one in WinGrid which isnt possible. If you have a sample project for this, please kindly attach it to this post. It would certainly benefit many of our other customers too.
Thanks very much !
ps. and the control of the webgrid and template controls is all done on the server.
Thanks for you input. Howevre I would beg to differ with your statement.
I agree that it is not possible to do this in the same fashion as the wingrid.It is possible and I have done it by using template columns and i can assign a different type of edit control to an individual cell in a column.. So, in fact, Row 1 column 1 can have a datetime control and row2 column1 can have a textedit control. So to say it is not possible would be incorrect.
I would be happy to share with you a sample project that is complete and does exactly what I have said. I spent a considerable amount of time trying to do this using dynamically created controls. and figured out that adding a number of controls to a cell template and then just showing the ones i needed works perfectly.