本文介绍了无法在GridView中看到下拉菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



页面加载时无法在gridview中看到下拉菜单.

Mycode在下面.
----------------


专业角色映射





编辑专业角色映射




< asp:标签ID ="LblMessage" runat =服务器" visible ="false" class ="red_text">


< asp:GridView ID ="GridView1" runat =服务器" align ="center" AllowPaging ="True" DataKeyNames =优先级"
AutoGenerateColumns ="False" class ="tabulardata" DataSourceID ="SqlDataSource1"
Horizo​​ntalAlign ="Center" Width ="100%" OnRowCommand ="GridView1_RowCommand"
OnRowDataBound ="GridView1_RowDataBound">
<列> < asp:TemplateField HeaderText ="Sl.No" ItemStyle-Horizo​​ntalAlign ="Center" ItemStyle-Width ="2%">
< itemtemplate>
< asp:标签ID ="Sno" runat ="server">

< itemstyle horizo​​ntalalign ="Center">

< asp:BoundField HeaderText =项目号" Visible ="true" DataField =优先级"
ItemStyle-Horizo​​ntalAlign ="center" ReadOnly ="true" SortExpression ="Priority">
< itemstyle horizo​​ntalalign ="Center" width ="3%">

< asp:BoundField HeaderText =当前名称" Visible ="true" DataField =名称"
ItemStyle-Horizo​​ntalAlign ="center" ReadOnly ="true" SortExpression ="Designation">
< itemstyle horizo​​ntalalign ="Center" width ="25%">

< asp:TemplateField HeaderText =专业角色">
< edititemtemplate>
< asp:DropDownList runat =服务器" ID ="ddlProfRole" DataValueField ="ProfRoleCode" DataSourceID ="SqlDataSource2" DataTextField ="ProfRoleDescription">


< asp:TemplateField HeaderText ="Edit" ItemStyle-Horizo​​ntalAlign ="Center">
< itemtemplate>
< asp:HyperLink ID ="hyperlink1" runat =服务器" Height ="20"
ImageUrl =〜/images/Access.gif"
宽度="20"/>

< itemstyle horizo​​ntalalign ="Center" width ="2%">

< alternatingrowstyle backcolor =#FFF5F5">



< asp:SqlDataSource ID ="SqlDataSource1" runat =服务器"
ConnectionString =<%$ ConnectionStrings:MPP%>"
SelectCommand =从按优先级的指定顺序中选择Designation,DesigCode,Priority,ProfRole">
<%-<删除参数>
< asp:参数名称="emp_number"类型="String"/>
-%>

< asp:SqlDataSource ID ="SqlDataSource2" runat =服务器"
ConnectionString =<%$ ConnectionStrings:MPP%>"
SelectCommand =从ProfppoleCode的mppProfRoleMapping顺序中选择ProfRoleCode,ProfRoleDescription,Designcode,DeptID">


请帮助

问候,
Ganesh.s

Hi,

I am unable to see dropdown in gridview while page load.

Mycode is below.
----------------


Professional Role Mapping





Edit Professional Role Mapping




<asp:Label ID="LblMessage" runat="server" visible="false" class="red_text">


<asp:GridView ID="GridView1" runat="server" align="center" AllowPaging="True" DataKeyNames="Priority"
AutoGenerateColumns="False" class="tabulardata" DataSourceID="SqlDataSource1"
HorizontalAlign="Center" Width="100%" OnRowCommand="GridView1_RowCommand"
OnRowDataBound="GridView1_RowDataBound">
<columns> <asp:TemplateField HeaderText="Sl.No" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="2%">
<itemtemplate>
<asp:Label ID="Sno" runat="server">

<itemstyle horizontalalign="Center">

<asp:BoundField HeaderText="Project Number" Visible="true" DataField="Priority"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="Priority">
<itemstyle horizontalalign="Center" width="3%">

<asp:BoundField HeaderText="Current Designation" Visible="true" DataField="Designation"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="Designation">
<itemstyle horizontalalign="Center" width="25%">

<asp:TemplateField HeaderText="Professional Role">
<edititemtemplate>
<asp:DropDownList runat="server" ID="ddlProfRole" DataValueField="ProfRoleCode" DataSourceID="SqlDataSource2" DataTextField="ProfRoleDescription">


<asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:HyperLink ID="hyperlink1" runat="server" Height="20"
ImageUrl="~/images/Access.gif"
Width="20" />

<itemstyle horizontalalign="Center" width="2%">

<alternatingrowstyle backcolor="#FFF5F5">



<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ConnectionStrings:MPP%>"
SelectCommand="select Designation,DesigCode,Priority,ProfRole from Designation order by Priority">
<%--<deleteparameters>
<asp:Parameter Name="emp_number" Type="String" />
--%>

<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ConnectionStrings:MPP%>"
SelectCommand="select ProfRoleCode,ProfRoleDescription,Designcode,DeptID from mppProfRoleMapping order by ProfRoleCode">


pls. help

Regards,
Ganesh.s

推荐答案




这篇关于无法在GridView中看到下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 07:51