Hi,
I am having trouble using the filtering in RadGrid. my code is as follows
.aspx
<radG:RadGrid
ID="RadGrid1"
runat="server"
EnableAJAX="True"
Skin="Glassy"
Width="97%"
AutoGenerateColumns="False"
PageSize="3"
AllowSorting="True"
AllowPaging="True"
AllowFilteringByColumn="True"
ShowStatusBar="true"
>
<PagerStyle Mode="Slider"></PagerStyle>
<SelectedItemStyle BackColor="PowderBlue"></SelectedItemStyle>
<HeaderStyle BackColor="#0E0997" Height="25px"></HeaderStyle>
<MasterTableView
DataKeyNames="AssetID"
AllowMultiColumnSorting="True"
Width="100%"
>
<ExpandCollapseColumn><HeaderStyle Width="19px"/></ExpandCollapseColumn>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px"/></RowIndicatorColumn>
<columns>
<radG:GridBoundColumn SortExpression="PARTNO" HeaderText="PART NUMBER" HeaderButtonType="TextButton"
DataField="PARTNO" UniqueName="PARTNO">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="HECI-CLEI" HeaderText="HECI-CLEI" HeaderButtonType="TextButton"
DataField="HECI-CLEI" UniqueName="HECI-CLEI">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="MANUFACTURE" HeaderText="MANUFACTURER" HeaderButtonType="TextButton"
DataField="MANUFACTURE" UniqueName="MANUFACTURE">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="QUANTITY" HeaderText="QUANTITY" HeaderButtonType="TextButton"
DataField="QUANTITY" UniqueName="QUANTITY">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="LOCATION" HeaderText="LOCATION" HeaderButtonType="TextButton"
DataField="LOCATION" UniqueName="LOCATION">
</radG:GridBoundColumn>
</columns>
</MasterTableView>
<ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True">
<Selecting AllowRowSelect="True" />
</ClientSettings>
</radG:RadGrid>
.cs
protected void Page_Load(object sender, EventArgs e)
{
SqlDataSource1.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
SqlDataSource1.ProviderName = "System.Data.SqlClient";
SqlDataSource1.SelectCommandType = SqlDataSourceCommandType.Text;
SqlDataSource1.SelectCommand = "SELECT [AssetID] AS 'AssetID',[AssetName] AS 'PARTNO',[HeciClei] AS 'HECI-CLEI',[AltCode] AS 'ATL-CODE',[Manufacturer] AS 'MANUFACTURE',[Quantity] AS QUANTITY,[Location] AS 'LOCATION' FROM tbl_Asset";
RadGrid1.DataSourceID = "SqlDataSource1";
RadGrid1.MasterTableView.DataSourceID = "SqlDataSource1";
}
The problem is that filtering works only once. I would really appritiate if somebody can tell me a way to use filtering without using asp:SqlDataSource i.e. bind grid in code behind
Thanks
maggi
I am having trouble using the filtering in RadGrid. my code is as follows
.aspx
<radG:RadGrid
ID="RadGrid1"
runat="server"
EnableAJAX="True"
Skin="Glassy"
Width="97%"
AutoGenerateColumns="False"
PageSize="3"
AllowSorting="True"
AllowPaging="True"
AllowFilteringByColumn="True"
ShowStatusBar="true"
>
<PagerStyle Mode="Slider"></PagerStyle>
<SelectedItemStyle BackColor="PowderBlue"></SelectedItemStyle>
<HeaderStyle BackColor="#0E0997" Height="25px"></HeaderStyle>
<MasterTableView
DataKeyNames="AssetID"
AllowMultiColumnSorting="True"
Width="100%"
>
<ExpandCollapseColumn><HeaderStyle Width="19px"/></ExpandCollapseColumn>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px"/></RowIndicatorColumn>
<columns>
<radG:GridBoundColumn SortExpression="PARTNO" HeaderText="PART NUMBER" HeaderButtonType="TextButton"
DataField="PARTNO" UniqueName="PARTNO">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="HECI-CLEI" HeaderText="HECI-CLEI" HeaderButtonType="TextButton"
DataField="HECI-CLEI" UniqueName="HECI-CLEI">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="MANUFACTURE" HeaderText="MANUFACTURER" HeaderButtonType="TextButton"
DataField="MANUFACTURE" UniqueName="MANUFACTURE">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="QUANTITY" HeaderText="QUANTITY" HeaderButtonType="TextButton"
DataField="QUANTITY" UniqueName="QUANTITY">
</radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="LOCATION" HeaderText="LOCATION" HeaderButtonType="TextButton"
DataField="LOCATION" UniqueName="LOCATION">
</radG:GridBoundColumn>
</columns>
</MasterTableView>
<ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True">
<Selecting AllowRowSelect="True" />
</ClientSettings>
</radG:RadGrid>
.cs
protected void Page_Load(object sender, EventArgs e)
{
SqlDataSource1.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
SqlDataSource1.ProviderName = "System.Data.SqlClient";
SqlDataSource1.SelectCommandType = SqlDataSourceCommandType.Text;
SqlDataSource1.SelectCommand = "SELECT [AssetID] AS 'AssetID',[AssetName] AS 'PARTNO',[HeciClei] AS 'HECI-CLEI',[AltCode] AS 'ATL-CODE',[Manufacturer] AS 'MANUFACTURE',[Quantity] AS QUANTITY,[Location] AS 'LOCATION' FROM tbl_Asset";
RadGrid1.DataSourceID = "SqlDataSource1";
RadGrid1.MasterTableView.DataSourceID = "SqlDataSource1";
}
The problem is that filtering works only once. I would really appritiate if somebody can tell me a way to use filtering without using asp:SqlDataSource i.e. bind grid in code behind
Thanks
maggi