hi,
thanks for the reply.
kindly review my code and tell me where i am wrong,
<radG:RadGrid ID="RadGrid1" runat="server" AllowCustomPaging="True"
AllowFilteringByColumn="True" AllowMultiRowEdit="True"
AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"
CellPadding="2" CellSpacing="2" DataSourceID="SqlDataSource1" EnableAJAX="True"
GridLines="None" Height="100px" OnItemCommand="RadGrid1_ItemCommand"
OnItemCreated="RadGrid1_ItemCreated" OnNeedDataSource="RadGrid_NeedDataSource"
PageSize="40" Skin="Vista" VirtualItemCount="65536" Width="100%"
AutoGenerateColumns="False">
<mastertableview cellpadding="2" cellspacing="2"
commanditemdisplay="Top" datakeynames="MetadataId" Height="200px"
datasourceid="SqlDataSource1" editmode="InPlace">
<filteritemstyle backcolor="#EFEBDE" />
<commanditemtemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CommandName="UpdateEdited" Text="UpdateChanges"></asp:LinkButton>
</commanditemtemplate>
<rowindicatorcolumn>
<HeaderStyle Width="20px" />
</rowindicatorcolumn>
<expandcollapsecolumn resizable="False" visible="False">
<HeaderStyle Width="20px" />
</expandcollapsecolumn>
<Columns>
<radG:GridBoundColumn DataField="MetadataId" DataType="System.Guid"
HeaderText="MetadataId" ReadOnly="True" SortExpression="MetadataId"
UniqueName="MetadataId">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="KeyWord" HeaderText="KeyWord"
SortExpression="KeyWord" UniqueName="KeyWord">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Value" HeaderText="Value"
SortExpression="Value" UniqueName="Value">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Sheet" HeaderText="Sheet"
SortExpression="Sheet" UniqueName="Sheet">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Row" HeaderText="Row" SortExpression="Row"
UniqueName="Row">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Column" HeaderText="Column"
SortExpression="Column" UniqueName="Column">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="ColumnDataType" HeaderText="ColumnDataType"
SortExpression="ColumnDataType" UniqueName="ColumnDataType">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="MetaDataType" HeaderText="MetaDataType"
SortExpression="MetaDataType" UniqueName="MetaDataType">
</radG:GridBoundColumn>
</Columns>
<EditItemStyle BackColor="transparent" />
<filteritemstyle backcolor="#EFEBDE" />
</mastertableview>
<exportsettings>
<pdf pagebottommargin="" pagefootermargin="" pageheadermargin=""
pageheight="11in" pageleftmargin="" pagerightmargin="" pagetopmargin=""
pagewidth="8.5in" />
</exportsettings>
<clientsettings>
<resizing allowcolumnresize="true" allowrowresize="true" />
<scrolling allowscroll="true" enableajaxscrollpaging="true"
usestaticheaders="true" />
<scrolling allowscroll="True" enableajaxscrollpaging="True"
usestaticheaders="True" />
<resizing allowcolumnresize="True" allowrowresize="True" />
</clientsettings>
<HeaderStyle Width="150px" />
</radG:RadGrid>
here is code behind
protected void RadGrid_NeedDataSource(object source, GridItemEventArgs e)
{
int startRowIndex = RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
int maximumRows = RadGrid1.PageSize;
int maxColumns = 15;
DataTable table = new DataTable();
for (int i = 0; i < maxColumns; i++)
{
table.Columns.Add(
new DataColumn("Column" + i));
}
for (int i = 0; i < maximumRows; i++)
{
int index = i + startRowIndex;
object[] data = new object[maxColumns];
for (int j = 0; j < maxColumns; j++)
{
data[j] =
"";
}
table.Rows.Add(data);
}
((
RadGrid)source).DataSource = table;
}
protected
void RadGrid1_ItemCommand(object source, Telerik.WebControls.GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.UpdateEditedCommandName)
{
//include custom code to update database here
}
}
protected void radtabstrip1_tabclick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
{
if (RadTabStrip1.Tabs[RadTabStrip1.Tabs.Count-1].Selected)
{
string sheetname = "sheet" +(RadTabStrip1.Tabs.Count);
Telerik.Web.UI.
RadTab rabtab = new Telerik.Web.UI.RadTab(sheetname);
Telerik.Web.UI.
RadTab rabtabadd = new Telerik.Web.UI.RadTab("+");
RadTabStrip1.Tabs.RemoveAt(RadTabStrip1.Tabs.Count-1);
RadTabStrip1.Tabs.Add(rabtab);
//telerik.web.ui.radpageview radpageview = new telerik.web.ui.radpageview();
//radpageview.controls.add(radgrid1);
//radmultipage1.pageviews.add(radpageview);
RadTabStrip1.Tabs.Add(rabtabadd);
}
}
The code is working fine but its not displaying the rows although record is populated in grid.
I have attached an image of how the grid is being displayed.
thanks
Samee Javaid