Wednesday, February 4, 2015

to push data points to a DetailRow in a DevExpress 13.1.9 grid...

Replace the "coming soon..." here with a Literal control like so:

<asp:Literal ID="Details" runat="server"></asp:Literal>

 
 

In C# you will need to wire up a .HtmlRowCreated event like so:

MyGrid.HtmlRowCreated += MyGrid_HtmlRowCreated;

 
 

...and pimp it out like this:

private void MyGrid_HtmlRowCreated(object sender,
      ASPxGridViewTableRowEventArgs e)
{
   if (e.RowType == GridViewRowType.Detail)
   {
      Literal literal = OrganizationManagementGrid
            .FindDetailRowTemplateControl(e.VisibleIndex, "Details") as Literal;
      Group group = (Group)OrganizationManagementGrid.GetRow(e.VisibleIndex);
      literal.Text = group.Notes;
   }
}

 
 

In this example, MyGrid is populated with a list of Group objects to begin with and we are casting each of the rows back to a Group object to get the Notes getsetter off of each Group so that we may put in in our Literal.

No comments:

Post a Comment