GridView未显示在内容页面中 [英] GridView is not shown in the content page

查看:99
本文介绍了GridView未显示在内容页面中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!!!

我的母版页中有一个gridview,我已经在其中包含了一个项目模板.最初,我已经为控件添加了一些文本.
在内容页面的设计视图中,gridview是可见的,但是在运行页面时,它不会显示gridview.
当我删除gridview并放置一些简单的文本代替它时,它开始工作.

我尝试设置z-索引和一些奇怪的东西,但似乎没有任何效果.请帮帮我

Hi all!!!!

I have a gridview in my Master page.I have taken an item template inside it. I have given some text to the controls initially.
In the design view of the content page gridview is visible but while running the page it''s not showing gridview.
when i deleted gridview and put some simple text in place of it ,it''s working .

i tried setting z- index and some peculiar things but nothing seems to work.Please help me out

推荐答案

最好是在那时放置代码看看这个链接,可能对您有帮助
> http://stackoverflow.com/questions/5433794/programaticly-textbox-to-gridview-没有数据源 [ ^ ]
即使数据源为空也显示GridView [
It''s better you place your code, by the time have a look at this link, might help you
http://stackoverflow.com/questions/5433794/programaticly-textbox-to-gridview-without-datasource[^]
Show GridView even if datasource is empty[^]
You need to bind your gridview.


首先绑定您的gridview
像这样一个:
bind your gridview first
like this one:
page_load()
{

gridview.Datasource = source();
gridview.Databind();

}



希望有帮助!



hope it helps!


有时,当您在网格中调用任何值并且网格中调用的值未连接到您的后端时,就会发生这种情况,因此请检查该值是否在您称为UR的值中出现在网格中.

使用fillgrid();

公共无效fillgrid()
{
DataTable dt = new DataTable();
dt = yourclass.yourmethod
Gridview1.DataSource = dt;
Gridview1.DataBind();
}
现在在页面加载以及您的保存按钮链接中调用此函数
Sometime it happens when u call any value in grid and the value called in grid is not connecting to ur backend then it happens so check the value is coming in ur values called in grid.

make a function of fillgrid();

public void fillgrid()
{
DataTable dt=new DataTable();
dt=yourclass.yourmethod
Gridview1.DataSource=dt;
Gridview1.DataBind();
}
now call this function in pageload as well as in ur save button link


这篇关于GridView未显示在内容页面中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆