View Complete Post
Hi i have one asp.net textbox control..
and one dropdownlist inside gridview itemtemplate textbox..
what my problem..?
A Textbox36 has values some thing like this A1','A2','A3
i wirte this below query in sqldatasource1 and this sqldarasource1 is binded to gridview ItemTemplate Dropdownlist..
Select ItemName from Table1 where code in (@C)
Here @C im refering to Textbox36..
It show me the record if it has one value if its multiple like A1','A2','A3 it not showing/filtering ItemName data..
Whatz the probel?
Argh.. I'm making the switch from vb.net to c#, and am just trying to bind some data from a reader in my c # codebehind, but no matter what, the gridview always skips the first row returned from my stored procedure. What am I doing wrong???
comm.CommandText = "123456";
reader = comm.ExecuteReader();
gvMenu.DataSource = reader;
i am using a gridview control in my aspx page. I want to set a Dataset as the datasource of the grid at programming end. But after filling the data in dataset and setting the data source property to Dataset grid is showing nothing.
If anyone can have any suggestions than please reply.
Here is my problem. I have a GridView, and I want Column1 to be equal to datatable data (filled by a SqlDataAdapter). Then I have two other fields by the SqlDataAdapter (first name, last name), and I want to have those two fields combined to form Column2. I have a TemplateField for my GridView that combines the first name and last name with Eval()'s, but the GridView places this combined field TemplateField and puts it as the first column.
How can I do this so that TemplateField can go in between fields that are databound? Thanks in advance. :)
I have a very simple form that contains an asp:GridView and a PgSqlDataSource (a datasource control for PostgreSQL from DevArt.com) which is part of a web site.
The asp:GridView is defined as follows:<asp:GridView ID="grdClasificacion" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" CellSpacing="1" DataKeyNames="clave" DataSourceID="dsClasificacion" PageSize="11"
Hi,am having trouble figuring this one out. Am using stored procedure and using databind for the gridview . i got the codes off other sites. I'm guessing its the code that i've underlined,how or what do i use as the datasource for the sorting event. I used the Session for the paging event and that works but not for sorting. any help would be appreciated.thanks
protected void LoadComplaint()
gvComReport.DataSource = CompTypeStatusBLL.GetComplaint(ddlStatus.SelectedValue, ddlType.SelectedValue);
Session["MyDataSet"] = gvComReport.DataSource;
protected void gvComReport_Sorting(object sender, GridViewSortEventArgs e)
DataTable dtSortTable = Session["MyDataset"] as DataTable;
if (dtSortTable != null)
DataView dvSortedView = new DataView(dtSortTable);
dvSortedView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);
gvComReport.DataSource = dvSortedView;
private string ConvertSortDirectionToSql(SortDirection sortDirection)
string newSortDirection = St
I want to display my <FooterTemplate> or just the textbox and button when the gridview is empty. Here is the code I have that works fine when my datasource is not null but when it is null I want to show the <FooterTemplate> I have.
Btw my project is VB.Net. Oh yeah <emptydatatemplate> did not work for me. I copied the below in between the <emptydatatemplate> and it did not work. So I removed the template tags inside <emptydatatemplate> and still did not work. Any suggestions?
<asp:GridView ID="mlbGridView" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="mlbDataSource" ShowFooter="True" OnRowCommand="mlbGridView_RowCommand"> <Columns> <asp:TemplateField>
<FooterTemplate> <asp:Button ID="btnInsert" runat="se
how can i said to a gridview to update his datasource from another page the point is that i'm on a gridview and then when o check fro details i open the details on a detailsview but i can change some info so when i save and returns back to the gridview it as the old info because datasource was not rebinded but i need to say what is the page and then use a find control but how can i said the anme of page?
what i want is this
i'm on page b and i want to update a gridview that is on page a
page.[page a].findcontrol[mycontrol on that page]