Gnanu

Gnanu

  • 1.7k
  • 52
  • 9k

Displaying user controls using OnDataBound

Apr 8 2019 5:19 AM
I have created two buttons using User controls
 
<input type="submit" value="Meeting Ended" align="center" style=" width: 120px; display: <%#(MeetingStatus) ? "inline" :"none"%>" class="buttonnew" />
 
<input type="submit" value="Completed" align="center" style="width: 120px; display: <%#(MeetingEnd) ? "inline" :"none"%>" class="buttonnew" /> 
 
 
Need to display them based upon this condition:
 
protected void dvControl_DataBound(object sender, EventArgs e)
{
foreach (DataRow row in _DataSource.Rows)
{
if (row["MEETING_ENDTIME"].ToString() != "")
{
MeetingStatus = false;
MeetingEnd = true;
}
else
{
MeetingStatus = true;
MeetingEnd = false;
}
}
}

but its binding based upon data table's last row.
I need to bind based upon 
 
if (row["MEETING_ENDTIME"].ToString() != "") .
It's taking last row values and displaying all fields based upon that. But i need to execute the condition for each and every  row

How to fix it?
Thanks in advance!