Display nested gridview - c#

I have a nested GridView with 4 levels,
when i click in "+" to show child GridView i make request to database to download data of current row, every thing work well for me, the only problem i have is in design, all the child GridView display in column of its parent GridView
this is how it looks:
Parent GridView
First Child gridView
here is my aspx code:
<asp:UpdatePanel ID="upNestedGridView" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="gvCostCenters" runat="server" ....>
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="imgShowAccountingPlan" runat="server" OnClick="Show_Hide_AccountingPlansGrid" .../>
<asp:Panel ID="pnlAccountingPlan" runat="server" Visible="false" Style="position: relative">
<asp:GridView ID="gvAccountingPlans" runat="server" AutoGenerateColumns="false"....">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="imgShowPrograms" runat="server" OnClick="Show_Hide_ProgramsGrid" .../>
<asp:Panel ID="pnlPrograms" runat="server" Visible="false" Style="position: relative">
<asp:GridView ID="gvPrograms" runat="server" AutoGenerateColumns="false" ...>
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="imgShowProjects" runat="server" OnClick="Show_Hide_ProjectsGrid" ..../>
<asp:Panel ID="pnlProjects" runat="server" Visible="false" Style="position: relative">
<asp:GridView ID="gvProject" runat="server" ....>
.....
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Label" HeaderText="البند " ItemStyle-HorizontalAlign="Right" />
....
</Columns>
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NumAccountingPlan" HeaderText="الخطة المحاسبية " ItemStyle-HorizontalAlign="Right" />
...
</Columns>
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
...
<asp:BoundField DataField="OperatingExpenses" HeaderText="المصروفات التشغيلية" DataFormatString="{0:#,##0.00;(#,##0.00);0}" />
</Columns>
</asp:GridView>
my jquery code:
<script type="text/javascript">
$(function () {
$("[src*=minus]").each(function () {
$(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>");
$(this).next().remove()
});
});
</script>
My code C#:
protected void Show_Hide_AccountingPlansGrid(object sender, EventArgs e)
{
try
{
ServiceClass service = new ServiceClass();
ImageButton imgShowHide = (sender as ImageButton);
GridViewRow row = (imgShowHide.NamingContainer as GridViewRow);
if (imgShowHide.CommandArgument == "Show")
{
_budget = service.GetBudgetById(int.Parse(hfIdBudget.Value));
row.FindControl("pnlAccountingPlan").Visible = true;
imgShowHide.CommandArgument = "Hide";
imgShowHide.ImageUrl = "/Content/img/minus.gif";
string idCostCenter = gvCostCenters.DataKeys[row.RowIndex].Value.ToString();
GridView gvAccountingPlans = row.FindControl("gvAccountingPlans") as GridView;
//gvAccountingPlans.ToolTip = costCenterId;
gvAccountingPlans.DataSource = AccountingPlanData(int.Parse(hfIdUser.Value), int.Parse(hfIdBudget.Value), int.Parse(idCostCenter));
gvAccountingPlans.DataBind();
}
else
{
row.FindControl("pnlAccountingPlan").Visible = false;
imgShowHide.CommandArgument = "Show";
imgShowHide.ImageUrl = "/Content/img/plus.gif";
}
}
catch (Exception ex) { GlobalHelpers.Trace(ex); }
}
I notice that when i delete the UpdatePanel the first child GridView display well, but the others no.
How can i do to display all childs GridView well?
I'm sorry for my bad english

Code asp:
<asp:UpdatePanel ID="upNestedGridView" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="gvCostCenters" runat="server" AutoGenerateColumns="false" ....>
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="imgShowAccountingPlan" runat="server" OnClick="Show_Hide_AccountingPlansGrid" ImageUrl="/Content/img/plus.gif" CommandArgument="Show" />
</ItemTemplate>
</asp:TemplateField>
....
<asp:TemplateField>
<ItemTemplate>
<tr visible="false" runat="server" id="trAccountingPlan">
<td visible="false" runat="server" id="tdAccountingPlan2"></td>
<td colspan="999" visible="false" runat="server" id="tdAccountingPlan">
<asp:GridView ID="gvAccountingPlans" runat="server" ....>
<Columns>
.....
</Columns>
</asp:GridView>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
Code C#:
protected void Show_Hide_AccountingPlansGrid(object sender, EventArgs e)
{
try
{
ImageButton imgShowHide = (sender as ImageButton);
GridViewRow row = (imgShowHide.NamingContainer as GridViewRow);
if (imgShowHide.CommandArgument == "Show")
{
...
imgShowHide.CommandArgument = "Hide";
imgShowHide.ImageUrl = "/Content/img/minus.gif";
row.FindControl("trAccountingPlan").Visible = true;
HtmlTableCell tdAccountingPlan = (HtmlTableCell)row.FindControl("tdAccountingPlan");
HtmlTableCell tdAccountingPlan2 = (HtmlTableCell)row.FindControl("tdAccountingPlan2");
tdAccountingPlan2.Visible = true;
tdAccountingPlan.Visible = true;
...
}
else
{
imgShowHide.CommandArgument = "Show";
imgShowHide.ImageUrl = "/Content/img/plus.gif";
row.FindControl("trAccountingPlan").Visible = false;
HtmlTableCell tdAccountingPlan = (HtmlTableCell)row.FindControl("tdAccountingPlan");
HtmlTableCell tdAccountingPlan2 = (HtmlTableCell)row.FindControl("tdAccountingPlan2");
tdAccountingPlan2.Visible = false;
tdAccountingPlan.Visible = false;
}
}
catch (Exception ex) { GlobalHelpers.Trace(ex); }
}

Related

Get textbox.text from nested gridview

I have a parent gridview with a child gridview
<!-- Parent -->
<asp:GridView ID="gvParent" runat="server" AutoGenerateColumns="false" Width="100%" CssClass="Grid"
DataKeyNames="SupplierReference" OnRowDataBound="gvParent_OnRowDataBound" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<img alt = "" style="cursor: pointer" src="images/plus.png" />
<asp:Panel ID="pnlOrders" runat="server" Style="display: none">
<!-- Child -->
<asp:GridView ID="gvChild" runat="server" AutoGenerateColumns="false" CssClass = "ChildGrid"
ShowFooter = "true" OnRowDataBound="gvChild_OnRowDataBound">
<Columns>
<asp:TemplateField HeaderText="Qty" ItemStyle-Width="100px">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#Eval("Qty")%>' />
</ItemTemplate>
</asp:TemplateField >
</Columns>
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkSelectQtys" runat="server"
CommandArgument = '<%# Eval("SupplierReference")%>' CommandName="SelectQtys"
OnClientClick = "return confirm('Add these materials to this task?')"
Text = "Add" OnClick="getQty" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
I am trying to have a textbox that the user can alter the value and when they click add I want to be able to pull that text into the C# code and work with it.
I cant get it into my C# code.
protected void getQty(object sender, EventArgs e)
{
//After clicking "add"....
//Do something here to get text from each TextBox1 in the Child gridview
}
Someone please help before I lose what little hair I have left...
protected void getQty(object sender, EventArgs e)
{
//After clicking "add"....
string s;
for(i=0; i < gvChild.Rows.Count; i++)
{
s = ((TextBox)gvChild.Rows[i].FindControl("TextBox1")).Text;
}
//Do what you want to with this string
}

page load with child grids taking too much of time in loading the page

I have three grids - Category grid, Items grid and Sub Items Grid. I have category grid (grdCategories) and for each category there are many items which i bind to child grids (grdItems). For every item there are many sub items which i display in sub child grid (grdSubItems). Now the problem is that page takes too much of time in loading the data. My HTML Code is below:
It takes even minutes to load the data:
ASPX
<asp:GridView ID="grdCategories" runat="server" AutoGenerateColumns="false" DataKeyNames="Category"
CssClass="menu_items" OnRowDataBound="grdCategories_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="pnlMealOptionsHeader" runat="server" Width="100%">
<h1>
<a id='<%# Eval("CategoryX")%>'>
<asp:Label ID="lblCategory" runat="server" Text='<%#Eval("Category") %>' Visible="false"></asp:Label>
<asp:Label ID="lblCategoryX" runat="server" Text='<%#Eval("CategoryX") %>'></asp:Label>
</a>
</h1>
</asp:Panel>
<asp:Panel runat="server" ID="pnlMealOptionsBody">
<asp:Label ID="lblCategoryXX" runat="server" CssClass="title_2" Text='<%#Eval("CategoryXX") %>'></asp:Label>
<!--Items in Category -->
<asp:GridView ID="grdItems" runat="server" AutoGenerateColumns="false" CssClass="active-grid"
DataKeyNames="Item" OnRowDataBound="grdItems_RowDataBound" ShowHeader="false" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblItem" runat="server" Text='<%#Eval("Item") %>' Visible="false"></asp:Label>
<asp:Label ID="lblItemX" CssClass="title" runat="server" Text='<%#Eval("ItemX") %>'></asp:Label>
<asp:Label ID="lblItemXX" CssClass="title" runat="server" Text='<%#Eval("ItemXX") %>' style=" font-size:smaller; font-weight:normal"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:GridView ID="grdSubItems" runat="server" AutoGenerateColumns="false" CssClass=""
DataKeyNames="SubItem" ShowHeader="false" OnRowDataBound="grdSubItems_RowDataBound">
<HeaderStyle HorizontalAlign="Left" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblItem" runat="server" Text='<%#Eval("Item") %>' Visible="false"></asp:Label>
<asp:Label ID="lblSubItem" runat="server" Text='<%#Eval("SubItem") %>' Visible="false"></asp:Label>
<asp:Label ID="lblNoofOptions" runat="server" Text='<%#Eval("NumofOptions") %>' Visible="false"></asp:Label>
<asp:Label ID="lblSubItemX" CssClass="qty" runat="server" Text='<%#Eval("SubItemX") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblPrice" runat="server" CssClass="price" Text='<%#String.Format("£{0}",Eval("SellingCost")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<!--End Items in Category -->
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<table width="900px">
<tr>
<td align="center">
<h1>
No Data Available</h1>
</td>
</tr>
</table>
</EmptyDataTemplate>
</asp:GridView>
Code Behind
Categories Gridview Bind
private void FillCategoriesGrid()
{
DataSet ds = new DataSet();
ShopCategoryMapBL bl = new ShopCategoryMapBL(SessionContext.SystemUser);
bl.FetchForShop(ds, RowId);
grdCategories.DataSource = ds.Tables[0].DefaultView;
grdCategories.DataBind();
}
Items Gridview Bind
protected void grdCategories_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridView chkTopings = e.Row.FindControl("grdItems") as GridView;
Label lblCategory = e.Row.FindControl("lblCategory") as Label;
FillItemsGrid(chkTopings, WebHelper.Cast(lblCategory.Text, 0));
}
}
protected void FillItemsGrid(GridView grdItems, int Category)
{
try
{
//int cleanOrder = CargoBag.GetValue("CleanOrder", 0);
DataSet aDataSet = new DataSet();
ItemBL bl = new ItemBL(SessionContext.SystemUser);
bl.FetchForCategory(aDataSet, Category, RowId);
grdItems.DataSource = aDataSet.Tables[0];
grdItems.DataBind();
}
catch (Exception ex) { }
}
Sub Items Gridview Bind
protected void grdItems_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridView grdSubItems = e.Row.FindControl("grdSubItems") as GridView;
Label lblItem = e.Row.FindControl("lblItem") as Label;
FillSubItemsGrid(grdSubItems, WebHelper.Cast(lblItem.Text, 0));
}
}
protected void FillSubItemsGrid(GridView grdSubItems, int Item)
{
try
{
//int cleanOrder = CargoBag.GetValue("CleanOrder", 0);
DataSet aDataSet = new DataSet();
SubItemBL bl = new SubItemBL(SessionContext.SystemUser);
bl.FetchForItem(aDataSet, Item);
grdSubItems.DataSource = aDataSet.Tables[0];
grdSubItems.DataBind();
}
catch (Exception ex) { }
}
You need to provide all of your code before we can provide an accurate answer.
For example:
Where SubItemBL is defined?
Also try to see what line is the exact bottleneck.
Is it
bl.FetchForCategory(aDataSet, Category, RowId);
or
grdSubItems.DataBind();
If above line is the bottleneck, note that Gridview binding to a datasource with large number of data is indeedslow. how large is your data?

GridViewRow not returning proper cells

So I have this problem with one of my pages, which basically lists out a bunch of comments for a specified student. The comments are supposed to be editable, but I'm having a problem with getting the contents of a row (so I can display the comment content in a TextBox and allow for edits).
The issue is that whenever I access the GridViewRow from the GridView like such:
this.CommentList.Rows[e.NewEditIndex]
It is returning a collection of cells, but whenever I try access the a cell like so: row.Cells[0].Text (where row is the selected GridViewRow object) it doesn't return any values.
Here is my .aspx code:
<asp:GridView ID="CommentList" runat="server" AutoGenerateColumns="False" CellPadding="5"
ShowHeader="false" Width="100%" DataKeyNames="CommentId" OnRowDeleting="CommentList_RowDeleting"
OnRowCancelingEdit="CommentList_RowCancelingEdit" OnRowEditing="CommentList_RowEditing">
<Columns>
<asp:TemplateField HeaderText="Student ID">
<ItemTemplate>
<b>Author:</b>
<%# ((Comment)Container.DataItem).Author.Name %>
<br />
<b>Date:</b>
<%# ((Comment)Container.DataItem).Created %>
<hr style="border-top: solid 1px black" />
<div style="text-align: center;">
<asp:Panel ID="OptionsPanel" runat="server">
<asp:LinkButton ID="DeleteLinkButton" CommandName="Delete" runat="server" OnClientClick="return confirm('Are you sure you want to delete this comment?');">Delete</asp:LinkButton>
|
<asp:LinkButton ID="EditLinkButton" runat="server" CommandName="Edit">Edit</asp:LinkButton>
</asp:Panel>
<asp:Panel ID="EditOptionsPanel" runat="server" Visible="false">
<asp:LinkButton ID="CancelEditLinkButton" runat="server" CommandName="Cancel">Cancel</asp:LinkButton>
</asp:Panel>
</div>
</ItemTemplate>
<ItemStyle CssClass="topLeftJustify" Width="200px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Panel ID="ViewCommentPanel" runat="server">
<%# ((Comment)Container.DataItem).Content%>
</asp:Panel>
<asp:Panel ID="EditCommentPanel" runat="server" Visible="false">
<asp:TextBox ID="Comment" runat="server" CssClass="textEntry" TextMode="MultiLine"
Width="100%" Height="100px"></asp:TextBox>
</asp:Panel>
</ItemTemplate>
<ItemStyle CssClass="topLeftJustify" />
</asp:TemplateField>
</Columns>
</asp:GridView>
Here is my .aspx.cs code (that relates to the code above):
protected void CommentList_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
GridViewRow row = this.CommentList.Rows[e.NewEditIndex];
((Panel)row.FindControl("OptionsPanel")).Visible = false;
((Panel)row.FindControl("EditOptionsPanel")).Visible = true;
((Panel)row.FindControl("ViewCommentPanel")).Visible = false;
((Panel)row.FindControl("EditCommentPanel")).Visible = true;
// problem is with this line. it doesn't show the contents of the "comment"
((TextBox)row.FindControl("Comment")).Text = row.Cells[0].Text;
}
catch (Exception ex)
{
this.Messages.ChangeMessage(ex.Message, MessageType.Error);
}
}
When you use a TemplateField you cannot use e.Row.Cells[index].Text to access a control text of the cell. I would simply add a Label to the panel.
But you can also try it this way:
Panel ViewCommentPanel = (Panel) e.Row.FindControl("ViewCommentPanel");
LiteralControl objPanelText = ViewCommentPanel.Controls[0] as LiteralControl;
TextBox Comment = (TextBox) row.FindControl("Comment");
Comment.Text = objPanelText.Text;

Hidden fields in a grid won't import to a edit form

I've got a grid that only displays one piece of information such as a title. Other fields are hidden. When you click edit a modal popup displays a form and imports the information from the grid for editing. The information in hidden field are not imported though. I don't want to display all the information in the grid because I have only room for the title.
How can I make this work? Thanks. Risho
<asp:GridView ID="gvForum" runat="server" DataSourceID="odsForumApproval" DataKeyNames="id" Width="200px"
RepeatColumns="1" DataKeyField="id" CssClass="gridview"
AutoGenerateColumns="False" GridLines="None" OnSelectedIndexChanged="_OnCommand">
<AlternatingRowStyle CssClass="altbgcolor" />
<Columns>
<asp:BoundField DataField="title" />
<asp:TemplateField >
<ItemTemplate>
<asp:HiddenField runat="server" ID="hfId" Value='<%# Eval("id") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
<asp:HiddenField runat="server" ID="hfDesc" Value='<%# Eval("description") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
<asp:LinkButton ID="lnkbtn" Text="Approve" runat="server" onclick="lnkbtn_Click"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
protected void lnkbtn_Click(object sender, EventArgs e)
{
LinkButton btndetails = sender as LinkButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
lblID.Value = gvrow.Cells[1].Text;
txtTitle.Text = gvrow.Cells[0].Text;
lblMessage.Text = gvrow.Cells[3].Text;
this.ModalPopupExtender1.Show();
}
The Cell-Text is empty if you are using TemplateFields with nested controls . You need to get the reference to the controls and use their appropriate properties(like TextBox.Text or HiddenField.Value). Therefor you can use FindControl on the GridViewRow:
var hfId = (HiddenField)gvrow.FindControl("hfId");
var hfDesc = (HiddenField)gvrow.FindControl("hfDesc");
txtTitle.Text = gvrow.Cells[0].Text;
lblID.Value = hfId.Value;
txtTitle.Text = hfdesc.Value;

Nested Update panel update child problem [duplicate]

I am having a nested update panel
something like this
<asp:UpdatePanel ID="DetailsUpdatePanel" runat="server" Visible="false" UpdateMode="Conditional" >
<ContentTemplate>
<div><ajaxToolkit:AsyncFileUpload runat="server" ID="BrochureUpload" Width="400px"
OnClientUploadError="BrochureuploadError"
OnClientUploadStarted="BrochureStartUpload"
OnClientUploadComplete="BrochureUploadComplete"
CompleteBackColor="Lime" UploaderStyle="Modern"
ErrorBackColor="Red" ClientIDMode="AutoID"
ThrobberID="Throbber"
UploadingBackColor="#66CCFF"
onuploadedcomplete="BrochureUpload_UploadedComplete"/>
<asp:Label ID="Label1" runat="server" Style="display: none">
<asp:Image runat="server" ID="Image1" ImageUrl="~/Images/uploading.gif" />
</asp:Label>
<asp:Label ID="brochurelblstatus" runat="server" Style="font-family: Arial; font-size: small;"></asp:Label></div>
<div><asp:UpdatePanel runat="server" ID="child" UpdateMode="Conditional" >
<ContentTemplate>
<div>
<asp:GridView ID=GridView2" runat="server" AllowPaging="true" AutoGenerateColumns="false" CellPadding="0" CellSpacing="1" DataKeyNames="ArticleId">
<Columns>
<asp:BoundField DataField="ArticleId" HeaderText="ArticleId" ReadOnly="True" HeaderStyle-CssClass="td1" />
<asp:BoundField DataField="FileName" HeaderText="FileName" ReadOnly="True" HeaderStyle-CssClass="td2" />
<asp:TemplateField HeaderText="BrochureUrl">
<ItemTemplate>
<asp:HyperLink ID="lnkEPhoto" runat="server" BorderWidth="2px" NavigateUrl='<%# GetUrl(Eval("ArticleId"),Eval("FileName")) %>'
Target="_blank"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="btnRemove" runat="server" text="Delete" CommandName="Delete" CausesValidation="False" OnClientClick="DeleteOrNo()">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel></div>
</ContentTemplate>
</updatePanel>
CodeBehind:
protected void BrochureUpload_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
{
if(BrochureUpload.HasFile)
{
if(BrochureUpload.PostedFile.ContentLength<=3670016 )
{
var brochurePath = MapPath("~/") + Path.GetFileName(e.filename);
BrochureUpload.SaveAs(brochurePath);
using (var dataContext = new NewsStandAloneDataContext(Config.StandaloneNewsConnectionString))
{
var brochure = new xxx
{
Id = Convert.ToInt32(GridView1.SelectedValue),
FileName = Path.GetFileName(e.filename),
RecordCreated = DateTime.Now
};
dataContext.xxx.InsertOnSubmit(brochure);
dataContext.SubmitChanges();
}
bindGridView();//I have code to bind gridview
Child.Update();
}
}
}
protected void bindBrochureGridView()
{
using (var dataContext = new NewsStandAloneDataContext(Config.StandaloneNewsConnectionString))
{
var brochureList = (from brochure in dataContext.xxx
where brochure.ArticleId == Convert.ToInt32(GridView2.SelectedValue)
select new ArcticleBrochure
{
ArticleId = brochure.ArticleId.ToString(),
FileName = brochure.FileName
}).ToList();
GridView1.DataSource = brochureList;
GridView1.DataBind();
}
}
When I upload the file , I want the giedview which is in the child updatepanel to be updated .But it doesnt work Any ideas?????
thanks in advance
Call child.Update(); in BrochureUpload_UploadedComplete event.
protected void BrochureUpload_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
{
....................
....................
bindGridView();//I have code to bind gridview
child.Update();
}
When file upload is complete then call Child.Update() method of UpdatePanel which contain gridview. You need to do that because you set UpdateMode="Conditional" in this case you have to manually update it in code.
ChildrenAsTriggers="True" in your updatepanel.

Categories

Resources