Click here to Skip to main content
15,917,928 members

Comments by DLSU-D Student (Top 23 by date)

DLSU-D Student 22-Apr-14 10:39am View    
Make sure your itextsharp.dll is in folder Bin. :)
DLSU-D Student 22-Apr-14 10:35am View    
I used this code for exporting gridview.

protected void Page_Load(object sender, EventArgs e)
{
string strQuery = "SQLCOMMAND HERE";
SqlCommand cmd = new SqlCommand(strQuery);
DataTable dt = GetData(cmd);
GridView1.DataSource = dt;
GridView1.DataBind();
}
private DataTable GetData(SqlCommand cmd)
{
DataTable dt = new DataTable();
String strConnString = System.Configuration.ConfigurationManager.ConnectionStrings["ProjectNameConnectionString1"].ConnectionString;
SqlConnection con = new SqlConnection(strConnString);
SqlDataAdapter sda = new SqlDataAdapter();
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
try
{
con.Open();
sda.SelectCommand = cmd;
sda.Fill(dt);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
con.Close();
sda.Dispose();
con.Dispose();
}
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}

protected void OnPaging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataBind();
}


Try this bro. :)
DLSU-D Student 17-Mar-14 9:10am View    
'ASP.adminsmdasma_pending_aspx' does not contain a definition for 'Gridview1_RowDataBound' and no extension method 'Gridview1_RowDataBound' accepting a first argument of type 'ASP.adminsmdasma_pending_aspx' could be found (are you missing a using directive or an assembly reference?)

This is another 1 bro.
DLSU-D Student 17-Mar-14 9:09am View    
'System.Web.UI.WebControls.GridViewCommandEventArgs' does not contain a definition for 'Row' and no extension method 'Row' accepting a first argument of type 'System.Web.UI.WebControls.GridViewCommandEventArgs' could be found (are you missing a using directive or an assembly reference?)

I get error again. It's say does not contain definition for 'Row'
DLSU-D Student 17-Mar-14 8:33am View    
System.Web.UI.WebControls.GridViewCommandEventArgs' does not contain a definition for 'findControl' and no extension method 'findControl' accepting a first argument of type 'System.Web.UI.WebControls.GridViewCommandEventArgs' could be found (are you missing a using directive or an assembly reference?)


Sir I get an error.

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999"
BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2"
DataSourceID="SqlDataSource1"
EmptyDataText="There are no data records to display." ForeColor="Black"
Width="724px">
<columns> <asp:BoundField DataField="Email_Address" HeaderText="Email_Address"
SortExpression="Email_Address" />
<asp:BoundField DataField="Order_Number" HeaderText="Order #"
SortExpression="Order_Number" />
<asp:BoundField DataField="Item_Purchased_Number"
HeaderText="Purchased #" SortExpression="Item_Purchased_Number" />
<asp:BoundField DataField="Branch" HeaderText="Branch"
SortExpression="Branch" />
<asp:BoundField DataField="Date_Issued" HeaderText="Date_Issued"
SortExpression="Date_Issued" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:BoundField DataField="Remarks" HeaderText="Remarks"
SortExpression="Remarks" />
<asp:CommandField ButtonType="Button" HeaderText="Update" ShowHeader="True"
ShowSelectButton="True" />
<footerstyle backcolor="#CCCCCC">
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<rowstyle backcolor="White">
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<sortedascendingcellstyle backcolor="#F1F1F1">
<sortedascendingheaderstyle backcolor="#808080">
<sorteddescendingcellstyle backcolor="#CAC9C9">
<sorteddescendingheaderstyle backcolor="#383838">


This is my gridview.


protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
e.findControl("Status").innerText = "Delivered";
}

This is in .cs