<ClientSettings EnablePostBackOnRowClick = "true">
<Selecting CellSelectionMode="MultiCell" />
<ClientEvents OnCellSelected="cellSelected" />
function cellSelected(sender, args) {
var selectedRow = args.get_row();
var selectedColumn = args.get_column();
var dataItem = args.get_gridDataItem();
var tableView = args.get_tableView();
var cellIndex = args.get_cellIndexHierarchical();
var output = String.format("Row:" + dataItem.get_itemIndexHierarchical() + ",Col:" + selectedColumn.get_uniqueName());
alert(output); <============= I want to delete(alert(output);
sender.get_masterTableView().fireCommand("cellSelected", output);
}
protected void gv_ItemConmmand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "cellSelected")
{
gvDetail.CurrentPageIndex = 0;
gvDetail.Rebind();
var clickedColumnName = e.CommandArgument.ToString();
}
}
Hi Anna,
One thing you can try is to wrap the fireCommand call inside a setTimeout() function so it gets called right after the cellSelected event listener execution:
setTimeout(function() { sender.get_masterTableView().fireCommand("cellSelected", output);})
Hello.
Attacted File : Res27.aspx, Res27.aspx.cs
I wrote the code as you taught me.
But, I wrote the code as you taught, But it doesn't work.
I have attached the file in question.
Question 1 ) Click the link below.
In RadGrid, BackColor Of Selected Cell in UI for ASP.NET AJAX | Telerik Forums
I wrote the code as you taught me.
However, if I write the code as you taught, it doesn't work.
Please check the attached files Res27.aspx and Res27.aspx.cs to see what the problem is.
In Res27.aspx, The code below is written.
html body .RadGrid .pinkCell{
background-image:none;
background-color: lightpink;
}
In Res27.aspx.cs, The code below is written.
item.CssClass = "pinkCell";
Question 2) Please check the attached file (Res27.aspx, Res27.aspx.cs)
setTimeout(function() { sender.get_masterTableView().fireCommand("cellSelected", output);})
In Attached file Res27.aspx, There is function cellSelected(sender, args).
In Attached file Res27.aspx.cs , There is if (e.CommandName == "cellSelected").
Please check the attached file Res27.aspx , Res27.aspx.cs.
Question 3) Click the link below.
Gap between Radgrid and RadTextbox in UI for ASP.NET AJAX | Telerik Forums
There is a gap between the Radgrid and RadTextbox.
I want there to be no gap between the grid and the box.
In Attached file Res27.aspx , There is
<telerik:GridTemplateColumn DataField="D0_T1" HeaderText="1T" Visible="true" ColumnGroupName="D0"><HeaderStyle Width="65px" CssClass="main_column_header2" HorizontalAlign="Center" VerticalAlign="Middle" Font-Size="11px"/>
<ItemStyle Width="65px" CssClass="rgAltRow" HorizontalAlign="Center" VerticalAlign="Middle" Height="22px" BackColor="White" />
<ItemTemplate>
<telerik:RadTextBox ID="D0_T1" runat="server" Text='<%#Bind("D0_T1")%>' MaxLength="4" Style="text-align: center" Width="60px" ></telerik:RadTextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
Telerik is so inconvenient.
keep waiting for an answer.
Hi Anna,
I would suggest we proceed with the communication about each separate issue in the specific thread you have opened for each one of them.
To your questions:
1) Please try setting the additional CssClass either in the ItemDataBound event (as I have suggested here - link) or in the RadGrid's PreRender event. The NeedDataSource event is too early to get and process the Text of RadGrid's cells. Let me know the result of testing this in the other thread you have opened particularly for this issue.
2) Please clarify what is the behavior when adding the setTimeout() function.
Is there any error thrown?
3) I have sent a message in the thread you have opened specifically for this issue.