Basically, what I'd like here is, if the checbox is selected on the page. The gridview should show only the records that has a specific username (his username). Otherwise, it should show all, as it shows now.
Any idea? - I have an idea, but am confused a bit with how to not display that column in gridview and still use it for such filtering.
Gridview data selection based on Checbox
Re: Gridview data selection based on Checbox
I'm sure you can hide a column but still use it for filtering. My memory is not so good with grids as I didn't use them for years.
Re: Gridview data selection based on Checbox
Alright, thank you. Say, I've half-handled it though need a little guidance with something else now.
I have a dropdown, like this
and want the Yes listitem value to be catched from code-behind file of public string variable namely, yesUserid.
What I tried is,
but it doesn't work, though it used to work with javascript when transferring the value to vars, but not here.
What to do? the second question is pretty complicated so am better off not asking it now and doing my best to solve that out.
But just to get a hint, is it possible to change the selectCommand of a datasource?, when some specific item of a dropdown is selected? I believe yes, using SelectedIndexChanged event and checking if its value is equal to a specific value, then accessing the sqldatasourcename.SelectCommand = .... am i making any sense here? hope I do...
I have a dropdown, like this
Code: Select all
<asp:DropDownList ID="DropDownList8" runat="server" AutoPostBack="True">
<asp:ListItem Value="%">No</asp:ListItem>
<asp:ListItem Value="">Yes</asp:ListItem>
</asp:DropDownList>
What I tried is,
Code: Select all
<asp:DropDownList ID="DropDownList8" runat="server" AutoPostBack="True">
<asp:ListItem Value="%">No</asp:ListItem>
<asp:ListItem Value="<%=yesUserid %>">Yes</asp:ListItem>
</asp:DropDownList>
What to do? the second question is pretty complicated so am better off not asking it now and doing my best to solve that out.
But just to get a hint, is it possible to change the selectCommand of a datasource?, when some specific item of a dropdown is selected? I believe yes, using SelectedIndexChanged event and checking if its value is equal to a specific value, then accessing the sqldatasourcename.SelectCommand = .... am i making any sense here? hope I do...