I have a gridview wrapped around update panel. I have two template fields in gridview as follows:
<asp:TemplateField HeaderText="User">
<ItemTemplate>
<asp:DropDownList ID="ddlUsers" runat="server"
AutoPostBack="true" OnSelectedIndexChanged="ddlUsers_SelectedIndexChanged"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Status" >
<ItemTemplate>
<div class="panel panel-default">
<div class="panel-heading"><asp:Literal runat="server" ID="lblSelectedUser" /></div>
<ul class="list-group">
<li class="list-group-item"><span class="strong">ID</span>: <asp:Literal runat="server" ID="lblId" /></li>
<li class="list-group-item"><span class="strong">Name</span>: <asp:Literal runat="server" ID="lblFullName"></asp:Literal></li>
<li class="list-group-item"><span class="strong">Email</span>: <asp:Literal runat="server" ID="lblEmail"></asp:Literal></li>
</ul>
</div>
</ItemTemplate>
</asp:TemplateField>
I can't set autopostback to "false" for the ddlUsers as I am updating the literal controls text values for the other template field properties in the ddlUsers_SelectedIndexChanged event. Is there a way to not cause a postback but still run the indexchanged event to update the other values in literal controls?
The dropdown text value is stored as Lastname,FirstName [ID] (Email) and somtimes as Lastname(Middle),Firstname [ID] (Email)
Is there a way to update the lblId, lblFullName and lblEmail to be the values from the dropdown in javascript and change the row for that gridview to be a different color without the selectedIndexChanged event firing?
so if the dropdown selected index is changed to "Gabriel, Josh [12345] (gabrielJ@test .com)" then the lblId would be 12345, lblFullName text would be Gabriel, Josh and lblEmail.text would be gabrielJ@test .com and the row backgroudn color would be lightgreen or something to denote that dropdown selection has been changed for the row.