Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
48 views

Hi,

 

I am using radfilter on a radlistview bound to a datasource. On pageload I use the following code to default show the filteritem Name from the datasource:

 

 

if (!IsPostBack)
{
       RadFilterTextFieldEditor editor = new RadFilterTextFieldEditor();
       RadFilterPartner.FieldEditors.Add(editor);
       if (!IsPostBack)
       {
              editor.FieldName = "NAME";
              editor.DataType = typeof(string);
              RadFilterContainsFilterExpression filter = new RadFilterContainsFilterExpression("NAME");
              filter.Value = "";
 
              RadFilterPartner.RootGroup.Expressions.Add(filter);
        }
}
 

 

My question is how I can set the focus on the NAME filteritem on pageload, so the user can start typing the filtertext, instead of manually click the filteritem and then typing the filtertext?

-Kurt

Mira
Telerik team
 answered on 31 Oct 2011
5 answers
107 views
I have  panel to contain all body
then i use ajax to control this panel 
Code show below
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" >
<AjaxSettings >
<telerik:AjaxSetting AjaxControlID ="rblCatLevel">
<UpdatedControls >
<telerik:AjaxUpdatedControl ControlID ="pnlMainCat" />
<telerik:AjaxUpdatedControl ControlID ="rblCatLevel" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy
I have a uploader inside the pnlMainCat

when i upload file, it cannot find the find 
i use radupload.UploadedFiles.Count , it always give me 0
when i remove ajax, it can work properly

<telerik:RadUpload ID="ruBanner" runat="server" EnableAjaxSkinRendering ="true"  EnableFileInputSkinning ="false" Width="50%" InitialFileInputsCount="1" ControlObjectsVisibility="None" />

Demo
I tried this demo , but it cant work
Rayne
Top achievements
Rank 1
 answered on 31 Oct 2011
3 answers
138 views
Hi,

I got an activex control that display images, and my page divided by frames that their size can be changed by RadSplitter when I'm dragging the splitter over the activex control I'm lossing the cursor, also if I'm open popup RadWindow over activex control I cant move the popup window there is some king conflict with rad control with my activex. The Activex control actualy very simple and standart its only display images like tiff, jpeg etc.

Any ideas how can I get it work.

Thanks.
Marin Bratanov
Telerik team
 answered on 31 Oct 2011
3 answers
192 views
In the code below, I get the error: Missing operand after 'NotEqualTo' operator. 

  if (!Page.IsPostBack)
            {
                grdGSRComp.MasterTableView.FilterExpression = "([Variance] NotEqualTo \'0\') ";
                GridColumn column = grdGSRComp.MasterTableView.GetColumnSafe("Variance");
                column.CurrentFilterFunction = GridKnownFunction.NotEqualTo;
                column.CurrentFilterValue = "0";
                grdGSRComp.MasterTableView.Rebind();
            }

This code runs in page_load.

tried different variations and none worked. Any ideas?

Thanks!
Ken
Top achievements
Rank 1
 answered on 31 Oct 2011
1 answer
96 views
Hi

the RadEditor is inside a AjaxUpdatedControl, I have the MaxTextLenght set and when it is exceeded, the message appears (the added text exceeded...), after the ajax loading panel appears but it gets stuck in an infinite loopthere. How can I stop this.

Thanks
Rumen
Telerik team
 answered on 31 Oct 2011
7 answers
559 views

Requirements

RadControls version

2008.01.0415.20
.NET version

2
Visual Studio version

2005
programming language

C#
browser support

all browsers supported by RadControls


 
PROJECT DESCRIPTION

This project presents how to add a select/deselect all option for selecting all rows in a grouped Grid by means of a CheckBox residing in the Grid header along with individual group selection. To accomplish this task a CheckBox is added to the Grid header inside the ItemCreated event handler. Set the AutoPostBack property of the CheckBox control to true and intercept the action execution
in the CheckChanged event of the CheckBox.

ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <br /> 
        <div> 
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true"  DataSourceID="SqlDataSource1" GridLines="None" AutoGenerateColumns="False" OnItemCreated="RadGrid1_ItemCreated" Skin="Hay"
                <MasterTableView DataSourceID="SqlDataSource1"
                    <RowIndicatorColumn Visible="False"
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn Resizable="False" Visible="False"
                        <HeaderStyle Width="20px" /> 
                    </ExpandCollapseColumn> 
                    <GroupByExpressions> 
                      <telerik:GridGroupByExpression> 
                       <GroupByFields> 
                         <telerik:GridGroupByField FieldName="Country" FieldAlias="Country" /> 
                       </GroupByFields> 
                       <SelectFields> 
                         <telerik:GridGroupByField FieldName="Country" FieldAlias="Country" /> 
                       </SelectFields> 
                      </telerik:GridGroupByExpression> 
                    </GroupByExpressions> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID"   DataType="System.Int32" SortExpression="CustomerID" 
                            UniqueName="CustomerID"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" 
                            UniqueName="CompanyName"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Country" HeaderText="Country" SortExpression="Country" UniqueName="Country"
                        </telerik:GridBoundColumn> 
                    </Columns> 
                    <EditFormSettings> 
                        <PopUpSettings ScrollBars="None" /> 
                    </EditFormSettings> 
                </MasterTableView> 
            </telerik:RadGrid><br /> 
            <br /> 
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthWindConnectionString %>" 
                SelectCommand="SELECT [CustomerID], [CompanyName], [Country] FROM [ Customers]"></asp:SqlDataSource> 
            &nbsp;</div> 
    </form> 
</body> 
</html> 
 

C#:
using System; 
using System.Data; 
using System.Configuration; 
using System.Web; 
using System.Web.Security; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.WebControls.WebParts; 
using System.Web.UI.HtmlControls; 
using Telerik.Web.UI; 
 
public partial class _Default : System.Web.UI.Page  
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridHeaderItem) 
        { 
            GridHeaderItem header = (GridHeaderItem)e.Item; 
            CheckBox headerchkbx = new CheckBox(); 
            headerchkbx.ID = "CheckBox2"
            headerchkbx.AutoPostBack = true
            headerchkbx.CheckedChanged += new EventHandler(headerchkbx_CheckedChanged); 
            header["column"].Controls.Add(headerchkbx); 
 
        } 
        if (e.Item is GridGroupHeaderItem) 
        { 
            GridGroupHeaderItem header = (GridGroupHeaderItem)e.Item; 
            CheckBox groupchkbx = new CheckBox(); 
            groupchkbx.ID = "CheckBox1"
            groupchkbx.AutoPostBack = true
            groupchkbx.CheckedChanged += new EventHandler(groupchkbx_CheckedChanged); 
            header.Controls[0].Controls.Add(groupchkbx); 
        } 
          
    } 
    void headerchkbx_CheckedChanged(object sender, EventArgs e) 
    { 
 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            CheckBox headerchkbx = (CheckBox)sender; 
            foreach (GridGroupHeaderItem groupHeader in RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader)) 
            { 
                GridItem[] children = groupHeader.GetChildItems(); 
                CheckBox groupchkbx = (CheckBox)groupHeader.Controls[0].FindControl("CheckBox1"); 
 
                if (headerchkbx.Checked) 
                { 
                    item.Selected = true
                    groupchkbx.Checked = true
                } 
                else 
                { 
                    item.Selected = false
                    groupchkbx.Checked = false
                } 
 
            } 
        } 
    } 
 
    void groupchkbx_CheckedChanged(object sender, EventArgs e) 
    { 
        int chkCount = 0
        foreach (GridGroupHeaderItem groupHeader in RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader)) 
        { 
            GridItem[] children = groupHeader.GetChildItems(); 
 
            CheckBox groupchkbx = (CheckBox)groupHeader.Controls[0].FindControl("CheckBox1"); 
            if ((groupchkbx.Checked)) 
            { 
                chkCount++; 
            } 
            foreach (GridItem child in children) 
            { 
                GridDataItem dataItem = child as GridDataItem; 
                dataItem.Selected = groupchkbx.Checked; 
 
                foreach (GridHeaderItem item in RadGrid1.MasterTableView.GetItems(GridItemType.Header)) 
                { 
                    CheckBox headerchkbx = (CheckBox)item["column"].FindControl("CheckBox2"); 
 
                    if ((!groupchkbx.Checked)) 
                    { 
                        headerchkbx.Checked = false
                    } 
                    if (RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader).Length == chkCount) 
                    { 
                        headerchkbx.Checked = true
                    } 
 
                } 
            } 
        } 
    } 

Naeem
Top achievements
Rank 1
 answered on 31 Oct 2011
0 answers
98 views
I had the same problem others seem to of have. Disabled RadComboBoxes were ugly when used on a page that had a FormDecorator and a parent Skin. Please see the resolution below:

div.RadComboBox_Vista .rcbDisabled INPUT.rcbInput
    {
        background-color: White !important;
        color: Gray !important;
    }

Assuming a Skin of 'Vista', this will style the disabled drop down. I made it simple, used the same background color as the table the control was in and choose a Gray fore color.

Hope it helps save someone the few hours it took me to amalgamate a solution.
Sugar
Top achievements
Rank 1
 asked on 31 Oct 2011
2 answers
87 views
how do i add custom context menu to the radgrid. thank you.
Ammar
Top achievements
Rank 1
 answered on 31 Oct 2011
3 answers
177 views
Hi,

I am trying to set the selected value for a radcombox box in the details view of a radgrid when it is in edit mode.  I have been able to do this for the mastertableview by doing the following on the grid's ItemDataBound event.

Private Sub rgvIntranetObjects_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgvIntranetObjects.ItemDataBound
      

        If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
            Dim GridItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
            Dim ddlModule As New DropDownList
            Dim ddlType As New DropDownList
            Dim txtModule As New TextBox
            Dim txtType As New TextBox
            ddlType = DirectCast(GridItem.FindControl("ddlObjectType"), DropDownList)
            ddlModule = DirectCast(GridItem.FindControl("ddlObjectModule"), DropDownList)
            txtType = DirectCast(GridItem.FindControl("txtObjectType"), TextBox)
            txtModule = DirectCast(GridItem.FindControl("txtObjectModule"), TextBox)
            ddlModule.SelectedValue = txtModule.Text
            ddlType.SelectedValue = txtType.Text
        End If
End Sub

I think that I need to do the same thing for the DetailsView on the DetailTableDataBind event but I can't figure out the correct syntax for checking if the details view is in edit mode (details view uses in-place editing) or how to get the row so that I can find the controls.

Any help would be appreciated.

Tracy

Tsvetina
Telerik team
 answered on 31 Oct 2011
1 answer
107 views
Hi

I've used the AddNewRecord functionality before and it worked great with a simple 1 GridBoundColumn input appearing. And the Insert/Cancel buttons appearing in the GridEditCommandColumn.

However I'm struggling with using the functionality where the columns are mixed between a GridTemplateColumn and GridBoundColumn. When I click the Add button an input textbox appears under the bound column but not under the template one?

I need it to be the other way around. Does anyone know how to control this? I've tried attaching ColumnEditorID to the template column and not the bound one, but this doesn't make a difference.

Thanks in advance,
Shinu
Top achievements
Rank 2
 answered on 31 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?