
| protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e) |
| { |
| string serverID = null; |
| string insertType = "master"; |
| GridEditFormItem gridEditFormItem = (GridEditFormItem)e.Item; |
| Hashtable ht = new Hashtable(); |
| gridEditFormItem.ExtractValues(ht); |
| if ("Systems".Equals(e.Item.OwnerTableView.Name)) |
| { |
| GridDataItem parentItem = (GridDataItem)e.Item.OwnerTableView.ParentItem; |
| serverID = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["ServerID"].ToString(); |
| insertType = "detail"; |
| } |
| presenter.InsertRecord(serverID, ht, insertType); |
| XmlDataSource1.Save(); |
| //rebind to get the real number of pages (incase adding an item increased the page count |
| RadGrid1.Rebind(); |
| if ("Systems" != e.Item.OwnerTableView.Name) |
| { |
| //set to last page |
| RadGrid1.CurrentPageIndex = RadGrid1.PageCount - 1; |
| //after changing page, need to rebind |
| RadGrid1.Rebind(); |
| } |
| else |
| { |
| GridTableView table = e.Item.OwnerTableView; |
| //set to last page |
| table.CurrentPageIndex = table.PageCount - 1; |
| //after changing page, need to rebind |
| table.Rebind(); |
| } |
| } |
<telerik:radupload id="RadUpload1" runat= "server"
allowedfileextensions=".doc,.rtf,.txt" />
<asp:customvalidator runat="server" id="CustomValidator1"
display="Dynamic"
clientvalidationfunction="ValidateRadUpload1"
>
Invalid extensions.
</asp:customvalidator>
<asp:button runat="server" id="Button1" text="Submit" />
<script type="text/javascript">
function ValidateRadUpload1(source, arguments)
{
arguments.IsValid = GetRadUpload('<%= RadUpload1.ClientID %>').ValidateExtensions();
}
</script>
i have 4 tabstrips and in the 3rd tab i m using radupload.
when i use the above code then error occured "the object doesnt support this property or method"
please help me

<telerik:GridTemplateColumn UniqueName="TemplateColumn" ItemStyle-HorizontalAlign = "Center">
<HeaderStyle Font-Bold = "true" Font-Names = "Verdana" Width = "15%" CssClass = "GridButton"/>
<HeaderTemplate>
<asp:CheckBox id="headerChkbox" AutoPostBack="True" runat="server"
oncheckedchanged="headerChkbox_CheckedChanged"></asp:CheckBox>
<asp:Button ID = "btnDelete" runat = "server" Text = "Delete" BackColor = "#336699" CssClass = "GridButton" ForeColor = "White" onclick="btnDelete_Click"/>
</HeaderTemplate>
protected void headerChkbox_CheckedChanged(object sender, EventArgs e)
{
if ((sender as CheckBox).Checked)
{
foreach (GridDataItem dataItem in radSurgicalHistory.MasterTableView.Items)
{
(dataItem.FindControl(
"chkRowSelection") as CheckBox).Checked = true;
dataItem.Selected =
true;
}
}
else
{
foreach (GridDataItem dataItem in radSurgicalHistory.MasterTableView.Items)
{
(dataItem.FindControl(
"chkRowSelection") as CheckBox).Checked = false;
dataItem.Selected =
false;
}
}
}
protected void chkRowSelection_CheckedChanged(object sender, EventArgs e)
{
((sender
as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;
}
try
{
if (radSurgicalHistory.MasterTableView.DataKeyNames.Length > 0)
{
string pkId = "";
string key = radSurgicalHistory.MasterTableView.DataKeyNames[0];
for (int i = 0; i < radSurgicalHistory.SelectedItems.Count; i++)
{
pkId = radSurgicalHistory.MasterTableView.DataKeyValues[radSurgicalHistory.SelectedItems[i].ItemIndex][key].ToString();
string delete = "Update M_SURGICAL_HISTORY SET ROW_STATUS = 0 where Pk_Surgical_History = " + pkId + "";
SqlHelper.ExecuteNonQuery(Utilities.GetConnectionString, CommandType.Text, delete);
}
radSurgicalHistory.Rebind();
}
}
catch (Exception ex)
{
radSurgicalHistory.Controls.Add(
new LiteralControl("Unable to delete Customers. Reason: " + ex.Message));
}
Hello,
I am trying to setup my Radgrid to select multiple rows. After following the demo (http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx), everything works great with one exception. I can not select or deselect rows using the Ctrl Key. The Shift Key works as expected.
Here is my code:
| <telerik:RadGrid ID="radgrdEvaluator" Skin="Vista" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True" ShowStatusBar="False" PageSize="10" GridLines="None" width="96%" HorizontalAlign="NotSet" Visible="False" runat="server"> |
| <MasterTableView DataKeyNames="EvaluatorID"> |
| <Columns> |
| <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"></telerik:GridClientSelectColumn> |
| <telerik:GridButtonColumn ButtonType="LinkButton" DataTextField="EvaluatorID" HeaderText="EvaluatorID" CommandName="Select"></telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="EvaluatorStatus" HeaderText="EvaluatorStatus" DataType="System.Boolean"></telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings EnableRowHoverStyle="True"> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| <pagerstyle mode="NextPrevAndNumeric" AlwaysVisible="True" /> |
| </telerik:RadGrid> |