Hi,
When set the select query and call the databind, it does not work because the databind only binds to the resultset available and setting the select query does not execute it. If you are using dataset or datatable, i would recommend using the rowfilter property on the defaultview of a datatable. For example
dTable.defaultview.rowfilt
C1Webgrid1.datasource=dTab
Hope it helps
Code Cruiser
Main Topics
Browse All Topics





by: RadicalSoftwareSolutionsPosted on 2008-08-28 at 23:09:39ID: 22342875
I thought it might help to include key parts of the aspx file
entPlaceHo lder1" Runat="Server"> Connection String %>">
" BackColor="White" " GridLines="Horizontal" > " HeaderText="Description" ption" AllowAutoSize="False">
<asp:Content ID="Content2" ContentPlaceHolderID="Cont
<asp:SqlDataSource ID="Tracker3Data" runat="server"
ConnectionString="<%$ ConnectionStrings:Tracker3
</asp:SqlDataSource>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" BorderColor="White" BorderWidth="6px"
Text="Select map set"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Selected="True" Value="0">All map sets</asp:ListItem>
<asp:ListItem Value="1">Map set 1</asp:ListItem>
<asp:ListItem Value="2">Map set 2</asp:ListItem>
<asp:ListItem Value="3">Map set 3</asp:ListItem>
<asp:ListItem Value="4">Map set 4</asp:ListItem>
<asp:ListItem Value="5">Map set 5</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<C1WebGrid:C1WebGrid ID="C1WebGrid1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False
BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataKeyField="veh_ID" DataSourceID="Tracker3Data
PageSize="20" AllowAutoSize="True" DefaultRowHeight="20px" Width="1403px"
HorizontalAlign="Left">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Left" />
<Columns>
<C1WebGrid:C1ButtonColumn CommandName="Select" Text="Select"
AllowAutoSize="False" ButtonType="PushButton">
</C1WebGrid:C1ButtonColumn>
<C1WebGrid:C1BoundColumn DataField="veh_Regno" HeaderText="Regno"
SortExpression="veh_Regno"
</C1WebGrid:C1BoundColumn>
<C1WebGrid:C1BoundColumn DataField="veh_Description
SortExpression="veh_Descri
</C1WebGrid:C1BoundColumn>
</Columns>
<PagerStyle BackColor="#4A3C8C" ForeColor="#E7E7FF" HorizontalAlign="Right"
Mode="NumericPages" Position="TopAndBottom" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<SelectedItemStyle BackColor="#738A9C" ForeColor="#F7F7F7" />
<AlternatingItemStyle BackColor="#F7F7F7" />
</C1WebGrid:C1WebGrid>
</ContentTemplate>
</asp:UpdatePanel>