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
395
Edit cell values server side
posted

Hi,

I am currently switching from webgrid to webdatagrid and have quite some trouble finding myself around in the new object model. Using webdatagrid was quite straightforward since there was rows and columns and intuitive prop names. Not so anymore...

Anyway, after some fiddling around I finally found out how retrieve the row values server side, however, I am unsure of how I change them. For example, I wish to change the texts in the first column to links. How do I do that? I started with the OnInitializeRow event and got the first cell, but then I don't know what to do...

Parents
No Data
Reply
  • 170
    Suggested Answer
    posted

    Hey John ,

    I had a simillar situation while upgrading to the new webdatagrid. The way I worked around it was to create a template column that would call a public function on the server example:

    Code on aspx page (as one of the columns in the grid control:

     <ig:TemplateDataField Key="HomeTeam" Width="110px">
     <ItemTemplate>
                    <%#GetPredictionDisplay( DataBinder.Eval(CType(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "HomeTeamName") %></asp:Label>
     </ItemTemplate>
     <Header Text="Home Team" />
    </ig:TemplateDataField>

    then the code in the function (.vb page) that returns the data:

     Function GetPredictionDisplay(ByVal AdvancingTeamID As Object) as String
    Dim NewTextCell as string
     If AdvancingTeamID is DBNull.value Then
      NewTextCell="<span id='p" & counter "'> Data Value is NULL </span>"
     else
        NewTextCell="<span id='p" & counter "'> SELECTED TEAM</span>"
     end if

     return NewTextCell

    End function

    I hope this helps you

    Best,

    DannyB

Children
No Data