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
3338
Question about grids.
posted

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

Parents
No Data
Reply
  • 1175
    posted

    Hi Daryl,

    The ASP.Net  version of the WinGrid is the WebGrid or also called UltraWebGrid.  However,  the WebGrid is not an exact replica of the WinGrid. Some functionalities are possible in one but not in the other grid due to the difference in the technologies/platforms and their own complexities.

    It is not possible to have different cells with different DataTypes in the WebGrid so you cannot assign different editors to different cells.  The datatype is assigned on the entire column as shown below :-

    protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
    {
            e.Layout.Bands[0].Columns.FromKey("EmployeeID").DataType = "System.Int32";
    }

    However if you need to have different ValueLists on different rows, this is possible in the WebGrid. Please see the below link :-

    http://help.infragistics.com/NetAdvantage/ASPNET/2010.1/CLR3.5/?page=WebGrid_Changing_ValueLists_on_a_Per_Row_Basis.html

     

Children