Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ASP.NET GridView问题中显示SSAS数据_Asp.net - Fatal编程技术网

在ASP.NET GridView问题中显示SSAS数据

在ASP.NET GridView问题中显示SSAS数据,asp.net,Asp.net,我使用adomd开发了一个ASP.NETWeb应用程序来显示ssas多维数据集数据 我可以将数据绑定到gridview中,但问题是我无法在gridview中显示标题名称。我也通读了下面的文章,但运气不好。有人知道怎么修吗 http://www.codeproject.com/Articles/28290/Microsoft-Analysis-Services-2005-Displaying-a-grid 感谢使用gridview的RowDataBound事件。然后在事件处理程序中检查标题行,并

我使用adomd开发了一个ASP.NETWeb应用程序来显示ssas多维数据集数据

我可以将数据绑定到gridview中,但问题是我无法在gridview中显示标题名称。我也通读了下面的文章,但运气不好。有人知道怎么修吗

http://www.codeproject.com/Articles/28290/Microsoft-Analysis-Services-2005-Displaying-a-grid

感谢使用gridview的
RowDataBound
事件。然后在事件处理程序中检查标题行,并在适当的单元格中设置适当的标题。例如,假设我们有这个gridview标记:

<asp:GridView runat="server" AutoGenerateColumns="True" ID="gv" OnRowDataBound="RowDataBound"></asp:GridView>
在rowdatabound事件处理程序中,我们可以这样做来更改标头:

protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.Header)
    {
        e.Row.Cells[0].Text = "My Custom Header";
    }
}

在gridview标记中使用
AutoGenerateColumns
false
,并在
@mshsayem]中手动定义列。感谢您的回复。我知道这会起作用。。但这里的诀窍是我使用girdview是为了动态结果…**也就是说,我将从treeview中选择我想要的字段并显示它们。**所以我不能硬编码列
protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.Header)
    {
        e.Row.Cells[0].Text = "My Custom Header";
    }
}