Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
167 views
Hi,
I am created a application using Telerik:RadGrid.It performs insert, update, delete operations successfully. I have taken a checkbox and a Button in header of one column and all the rows of that column contain checkboxex. Whenever I select the checkboxed and click on the delete button it deletes the selected records from the grid. When i Select the Header checkbox , it will select all the records of the grid with in that page and by click on the delete button it deletes all the records from that page. 

    I want to delete all the records across the grid when ever i select the header checkbox and click the Delete button instead delete records page wise. Can anybody help me to solve this problem.
Here is my code used to delete records page wise.

 

<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>

 



.cs:.

 

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));

 

}

Yavor
Telerik team
 answered on 05 Aug 2009
2 answers
101 views
I would like to have the statusbar, but it should be empty. I set VisibleStatusbar="true". On the client side I call oWnd.set_status(''); . As a result of that, I have the statusbar visible and during loading it has no information. But unfortunately, when the it's loaded, the statusbar has the url. Is there any way not to have the url information in the statusbar, but have it visible?

Thank you,

Tatiana
DW Web Team Member
Top achievements
Rank 2
 answered on 05 Aug 2009
3 answers
319 views
Hi,

I want to restrict user to select/browse only restricted files, like in html file upload control we have a property called 'Accept' which will take the parameters as file types with cama seperated.

ex: <input type="file" accept="image/jpg,image/png" name="file1" />

I want to know whether this property is availabe in Rad Upload control?

Thanks.
Atanas Korchev
Telerik team
 answered on 05 Aug 2009
3 answers
233 views

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> 
Mira
Telerik team
 answered on 05 Aug 2009
2 answers
139 views
I'm doing customization of FileExplorer but I've got strange strings like "Common_Open," "Common_Select" in the tooltips and buttons. Since I didn't put any string like above, it's so weird where they come from. Simply, I want to make the string as just "Open" and "Select" etc.

Any idea?
Tom
Top achievements
Rank 1
 answered on 05 Aug 2009
1 answer
158 views
Hi,

I have a form which contains textbox and radio button controls in which some textboxes are mandatory. I have a radio button and textbox where the textbox will be enabled when I click on the radio button. The textbox should be a mandatory field only when the textbox is enabled. When the textbox is disabled/read only, it should not be considered as a mandatory field.

But, in my scenario it is considering the disabled/readonly textbox also as mandatory field. How can change this behaviour??

Thanks,
Mahesh
Shinu
Top achievements
Rank 2
 answered on 05 Aug 2009
2 answers
61 views
Hello,

I got a problem with Drag&Drop of a TreeNode. In a simple web project this false behaviour doesn't appear. But in my bigger project I have the following problem:

I got on an aspx site a simple TreeView control...

    <form runat="server" id="telerik" > 
      
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
                 
        <div> 
            <telerik:RadTreeView ID="myTreeView" runat="server" EnableDragAndDrop="True" 
                EnableDragAndDropBetweenNodes="true" OnNodeDrop="myTreeView_NodeDrop">  
            </telerik:RadTreeView> 
        </div>                  
          
        <asp:LinkButton ID="newpagelink" Text="" OnClick="AddTab_Click" class="normal" runat="server" /> 
    </form> 
 

My code behind looks like this...
...      
 
Protected Sub myTreeView_NodeDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeDragDropEventArgs)  
        Dim sourceNode As RadTreeNode = e.SourceDragNode  
        Dim destNode As RadTreeNode = e.DestDragNode  
        Dim dropPosition As RadTreeViewDropPosition = e.DropPosition  
 
        If destNode IsNot Nothing Then 
            If sourceNode.TreeView.SelectedNodes.Count <= 1 Then 
                PerformDragAndDrop(dropPosition, sourceNode, destNode)  
            ElseIf sourceNode.TreeView.SelectedNodes.Count > 1 Then 
                For Each node As RadTreeNode In sourceNode.TreeView.SelectedNodes  
                    PerformDragAndDrop(dropPosition, node, destNode)  
                Next 
            End If 
 
            destNode.Expanded = True 
            sourceNode.TreeView.ClearSelectedNodes()  
        End If 
    End Sub 
      
...  
      

If i'm debugging into this event everytime the RadTreeNodeDragDropEventArgs are empty, that means, the e.SourceDragNode and the e.DestDragNode are nothing!

Does anybody has a solution for me or an idee how this can be?!

Thanks for help!!!

Best regards from Germany,
Steven***
contentXXL
Top achievements
Rank 1
 answered on 05 Aug 2009
3 answers
364 views
How do I handle licensing of RADControls-Ajax on our build server? Since licensing is per-seat, does the build server need a license?
Lidiya
Telerik team
 answered on 05 Aug 2009
5 answers
154 views
I would like to Upload only a certain type of files eg .doc and code is liekthe one below, but its not working.
if(!IsPostBack)
            {
                RadUpload1.AllowedFileExtensions = new string[] {".doc", ".txt"};
               }
but it keeps picking up every file in a folder. does anyone know what im doing wrong. plse help me if possible.
DK
Top achievements
Rank 2
 answered on 05 Aug 2009
3 answers
112 views
I would like to use the tabstrip so that each tab points to a page. I don't want the control to navigate to the page, I want the page I reference to be the content of the tab. Is this possible?

I tried using the MultiPage example, but if you specify different URL's for each tab, the control just redirects you to the referenced page.
Peter
Telerik team
 answered on 05 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?