This is a migrated thread and some comments may be shown as answers.

grids side by side again

2 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 09 Jun 2012, 07:16 PM
original thread

http://www.telerik.com/community/forums/aspnet-ajax/grid/grids-side-by-side.aspx 

My problem was never resolved and my reply seems to have gone unnoticed.

I need some advice on what control i need to use to organzie my grids and other controls.. I want 2 grids side by side but i seem to beunable to do this. Whats the best way to organize controls? 

Cant get the radsplitter to behave like was suggested in my original post.

Thanks

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 10 Jun 2012, 04:02 PM
Hello,

Please check below code and attached image.
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DateTime dt = DateTime.Today;
 
            dynamic data = new[] {
              new { ID = 1, Name ="name1",CustomDate=dt},
              new { ID = 2, Name = "name2",CustomDate=dt.AddDays(-1)},
              new { ID = 3, Name = "name3",CustomDate=dt.AddDays(-2)},
              new { ID = 4, Name = "Name4",CustomDate=dt.AddDays(-3)},
               new { ID = 5, Name ="name5",CustomDate=dt}
            };
            RadGrid1.DataSource = data;
        }
 
        protected void RadGrid2_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DateTime dt = DateTime.Today;
 
            dynamic data = new[] {
              new { ID = 1, Name ="name1",CustomDate=dt},
              new { ID = 2, Name = "name2",CustomDate=dt.AddDays(-1)},
              new { ID = 3, Name = "name3",CustomDate=dt.AddDays(-2)},
              new { ID = 4, Name = "Name4",CustomDate=dt.AddDays(-3)},
               new { ID = 5, Name ="name5",CustomDate=dt}
            };
            RadGrid2.DataSource = data;
        }
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
       </telerik:RadScriptManager>
        
       <telerik:RadSplitter ID="Splitter1" runat="server" Orientation="Vertical">
           <telerik:RadPane ID="RadPane1" runat="server">
               <telerik:RadGrid ID="RadGrid1" runat="server"  AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource">
               <MasterTableView>
                   <Columns>
                       <telerik:GridBoundColumn DataField="ID"></telerik:GridBoundColumn>
                   </Columns>
               </MasterTableView>
               </telerik:RadGrid>
           </telerik:RadPane>
           <telerik:RadPane ID="RadPane2" runat="server">
               <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="false" OnNeedDataSource="RadGrid2_NeedDataSource">
                   <MasterTableView>
                   <Columns>
                       <telerik:GridBoundColumn DataField="ID"></telerik:GridBoundColumn>
                   </Columns>
               </MasterTableView>
               </telerik:RadGrid>
           </telerik:RadPane>
       </telerik:RadSplitter>


Thanks,
Jayesh Goyani
0
Naresh
Top achievements
Rank 1
answered on 11 Jun 2012, 03:14 AM
Hey jayesh, sorry this is not the place to post this thing, but i am unable to reply to that thread for the last 4 days (the telerik forum bug, can't reply to the post you created)
with the solution you provided i was able to get the sorting icon on the left side, but it shows below the header-text. tried few style fixes but didn't help, any clue for that? 
here is the link to that thread
http://www.telerik.com/community/forums/aspnet-ajax/grid/sort-icon-on-the-left-or-always-show-sort-icon-when-column-width-is-fixed.aspx 
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Naresh
Top achievements
Rank 1
Share this question
or