Hi , I have set all the properties, But still click on the row and cell doesn't make selection .. Please help.
<Infragrid:WebDataGrid ID="UserGroupDetails" AutoGenerateColumns="false" runat="server"
OnInitializeRow="UserGroupDetails_InitializeRow" EnableTheming="true" height="230px" EnableDataViewState="true"
EnableAjaxViewState="true" EnableAjax="false" >
<Columns>
<Infragrid:TemplateDataField Key="Description" Width="31%" >
<HeaderTemplate>Name</HeaderTemplate>
<ItemTemplate>
<asp:Image ID="UserGroupImage" runat="server" style="float: left;"></asp:Image>
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "Description")%>
</ItemTemplate>
</Columns>
<Behaviors>
<Infragrid:Selection CellClickAction="Row" RowSelectType="Multiple">
</Infragrid:Selection>
<Infragrid:RowSelectors>
</Infragrid:RowSelectors>
<Infragrid:Activation>
</Infragrid:Activation>
</Behaviors>
Could you provide more details about what you are doing on the server, particularly in your InitializeRow event and where you are setting the grid's data source? Using the markup that you have provided I was not able to reproduce this behavior. When I click on a row it is selected as expected. Please see my attached sample and let me know if you are able to reproduce the behavior in the sample.
Hi Jason,
Thanks for the response. I pasted the databinding , aspx file and Row_Initialize code. It shows the Select column on the grid but by clicking on the doesn't select the row or highlight the row.
protected void dgBudgetApprovalAlerts_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e)
{
int alertKey;
GridRecordItem currentCellItem = e.Row.Items.FindItemByKey("Action");
Label hdnActivityType = (Label)currentCellItem.FindControl("hdnActivityType");
string activityType = PWWebHelper.GetWebSafeTrimmedString(hdnActivityType.Text);
if (activityType == PWWebHelper.GetWebSafeTrimmedString(ActivityType.Medical))
Label hdnAlertKey = (Label)currentCellItem.FindControl("hdnAlertKey");
alertKey = PWWebHelper.GetWebSafeInt(hdnAlertKey.Text);
RadioButtonList Action = (RadioButtonList)currentCellItem.FindControl("Actions");
Action.Items[0].Attributes.Add("onclick", "return CaptureApproveClick(" + alertKey + "," + e.Row.Index + ");");
Action.Items[1].Attributes.Add("onclick", "return CaptureDenyClick(" + alertKey + "," + e.Row.Index + ");");
}
ASPX page:
<Infragrid:WebDataGrid ID="dgBudgetApprovalAlerts" runat="server" Width="100%"
OnColumnSorted="dgBudgetApprovalAlerts_SortColumn"
OnInitializeRow="dgBudgetApprovalAlerts_InitializeRow" EnableTheming="true" AutoGenerateColumns="false">
<Infragrid:TemplateDataField Key="ActivityNumber" Width="15%" Header-Tooltip="Sort by ActivityNumber">
<HeaderTemplate>
Activity #</HeaderTemplate>
<div style="word-wrap: break-word; padding-right: 1px;">
<asp:HyperLink ID="ActivityNumber" runat="server" Target="_top" NavigateUrl='<%# FormatUrl(DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ActivityNumber"), DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ActivityType"))%>'>
<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ActivityIdentity")%>
</asp:HyperLink><br />
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "StartDate")%>
</div>
</Infragrid:TemplateDataField>
<Infragrid:TemplateDataField Key="BrandDisease" Width="15%" Header-Tooltip="Sort by BrandDisease">
Brand/Disease</HeaderTemplate>
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "BrandDisease")%>
<Infragrid:TemplateDataField Key="AddedBy" Width="15%" Header-Tooltip="Sort by Added By">
Added By</HeaderTemplate>
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AddedBy")%>
<Infragrid:TemplateDataField Key="ActivityType" Width="15%" Header-Tooltip="Sort by Activity Type">
Activity Type</HeaderTemplate>
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ActivityType")%>
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ConsultantName")%>
<Infragrid:TemplateDataField Key="TotalBudget" Width="15%" Header-Tooltip="Sort by TotalBudget">
Total Budget</HeaderTemplate>
<div style="text-align:right">
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "TotalBudget")%>
<Infragrid:TemplateDataField Key="ToBeApprovedBy" Width="15%" Header-Tooltip="Sort by ToBeApprovedBy">
To Be Approved By</HeaderTemplate>
<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ToBeApprovedBy")%>
<Infragrid:TemplateDataField Key="Action" Width="15%">
Action</HeaderTemplate>
<asp:RadioButtonList ID="Actions" runat="server" RepeatDirection="Vertical" CssClass="infragrid-radio"
Enabled='<%# Convert.ToBoolean(DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "CanBeApproved"))%>'>
<asp:ListItem Value="1">Approve</asp:ListItem>
<asp:ListItem Value="2">Deny</asp:ListItem>
</asp:RadioButtonList>
<div id="approvalReasonDiv<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey")%>"
style="display: none">
<%# FormatApprovalReasonLink(DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey"))%>
<div id="denialReasonDiv<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey")%>"
<%# FormatDenialReasonLink(DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey"))%>
<input id="HdnApr<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey")%>"
name="HdnApr<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey")%>"
type="hidden" />
<input id="HdnDen<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey")%>"
name="HdnDen<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem,"AlertKey")%>"
<input id="HdnFile<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem,"AlertKey")%>"
name="HdnFile<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem,"AlertKey")%>"
<input id="HdnClick<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem,"AlertKey")%>"
name="HdnClick<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem,"AlertKey")%>"
<asp:Label ID="hdnActivityKey" Visible="false" runat="server" Text='<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ActivityNumber")%>'></asp:Label>
<asp:Label ID="ApprovalLevel" Visible="false" runat="server" Text='<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ApprovalLevel")%>'></asp:Label>
<asp:Label ID="hdnAlertKey" Visible="false" runat="server" Text='<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "AlertKey")%>'></asp:Label>
<asp:Label ID="hdnConsultantkey" Visible="false" runat="server" Text='<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "Consultantkey")%>'></asp:Label>
<asp:Label ID="hdnActivityType" Visible="false" runat="server" Text='<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ActivityType")%>'></asp:Label>
<Infragrid:Sorting Enabled="true" SortingMode="Single" AscendingImageUrl="" AscendingImageAltText=""
DescendingImageAltText="" DescendingImageUrl="">
<ColumnSettings>
<Infragrid:SortingColumnSetting ColumnKey="Action" Sortable="false" />
</ColumnSettings>
</Infragrid:Sorting>
Datasource binding:
dgBudgetApprovalAlerts.DataSource = m_ResultDataSet;
dgBudgetApprovalAlerts.DataBind();
Enter.Visible = true;
Pager1.Visible = true;
dgBudgetApprovalAlerts.Visible = true;