+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Issues viewing event info using RadGrid in a custom widget

Issues viewing event info using RadGrid in a custom widget

3 posts, 1 answered
  1. Gina McCarty
    Gina McCarty avatar
    5 posts
    Registered:
    23 Feb 2006
    18 Jul 2013
    Link to this post
    I'm using the fluent API to call the events data and inserting it into a RadGrid. The issue that I'm having is that some of the fields are appearing (Title, Street, City, State) and some are not (Start Date, End Date, Contact info etc). I've attached a screen shot of the event table in the database so you can see the data exists and also a screen shot of the RadGrid as it appears int he browser. Does anyone know why this is happening?

    Here is my code-behind code:
    protected void Page_Load(object sender, EventArgs e)
    {
      var events = from p in App.WorkWith().Events().Published().Get().ToList()
              select p;
     
      rgEvents.DataSource = events;
      rgEvents.DataBind();
    }

    Here is my RadGrid code:
    <telerik:RadGrid runat="server" ID="rgEvents" Width="100%">
        <MasterTableView AutoGenerateColumns="false">
            <Columns>
                <telerik:GridBoundColumn DataField="title" HeaderText="Title" UniqueName="Title"></telerik:GridBoundColumn>            
                <telerik:GridDateTimeColumn DataField="event_start" HeaderText="Starts"></telerik:GridDateTimeColumn>
                <telerik:GridDateTimeColumn DataField="event_end" HeaderText="Ends"></telerik:GridDateTimeColumn>
                <telerik:GridBoundColumn DataField="street" HeaderText="Street"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="city" HeaderText="City"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="state" HeaderText="State"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="contact_name" HeaderText="Contact Name"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="contact_cell" HeaderText="Contact Cell"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="contact_email" HeaderText="Contact Email"></telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
  2. Mark
    Mark avatar
    147 posts
    Registered:
    01 Jun 2010
    18 Jul 2013 in reply to Gina McCarty
    Link to this post
    Try EventStart, EventEnd, ContactName, ContactPhone, ContactEmail
    Answered
  3. Gina McCarty
    Gina McCarty avatar
    5 posts
    Registered:
    23 Feb 2006
    18 Jul 2013 in reply to Mark
    Link to this post
    Thanks. That worked. How did you know to use those names? Is that in the API documentation? Because I can't find that anywhere. I'm running version 6.

    EDIT: Never mind. I finally found the API reference and see where they are.
3 posts, 1 answered