Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
235 views
Hi all!
I have a problem with the event CreateColumnEditor of a RadGrid. My code has to generate a Column Editor for the TextBox a different one for the ComboBox. The problem is that the event is fired even if I haven't pressed the edit button yet. I can assure it because I did debug it. This happens only when I add the part of code that follows:
 if (e.Column is GridDropDownColumn)......

Here there is the C# code:

protected void RadGrid_Processes_CreateColumnEditor(object sender, GridCreateColumnEditorEventArgs e)
{
    Unit width;
    String str;

    if (e.Column is GridBoundColumn)
    {
        width = e.Column.HeaderStyle.Width;
        str = (e.Column as GridBoundColumn).DataField;
        int indexEditing=0;
        bool even = true;
        
        switch (entityType)
        {
            case "COMP":

                if (str.Equals("Code"))
                {
                    e.ColumnEditor = new TextBoxColumnEditor(10, true, str, width, true, true, hfCodes.Value, even);
                }
                break;

            default:
                break;
        }
    }

    if (e.Column is GridDropDownColumn)
    {
        str = (e.Column as GridDropDownColumn).DataField;
        switch (entityType)
        {
            case "CTRL":
                if (str.Equals("FK_ControlType"))
                {
                    e.ColumnEditor = new DropDownColumnEditor(true, str, true);
                }
                break;

            default:
                break;
        }
    }
}

Here there is the ASP.NET code:

        <telerik:RadGrid ID="RadGrid_Processes" runat="server"
            AutoGenerateColumns="False" DataSourceID="LinqDataSource_Entities"
            oninit="RadGrid_Processes_Init"
            onitemcreated="RadGrid_Processes_ItemCreated" GridLines="None"
            onitemcommand="RadGrid_Processes_ItemCommand"
            onitemdatabound="RadGrid_Processes_ItemDataBound"
            onprerender="RadGrid_Processes_PreRender"
            onneeddatasource="RadGrid_Processes_NeedDataSource"
            ondatabinding="RadGrid_Processes_DataBinding" onload="RadGrid_Processes_Load"
            OnCreateColumnEditor="RadGrid_Processes_CreateColumnEditor"    >
            <SelectedItemStyle CssClass="rgAltRow" />
            <MasterTableView DataKeyNames="Id"
                    EditMode="InPlace" CommandItemDisplay="Bottom" InsertItemDisplay="Bottom" >
                <EditFormSettings>
                    <FormTableItemStyle HorizontalAlign="Left" />
                    <FormTableAlternatingItemStyle HorizontalAlign="Left"/>
                </EditFormSettings>
                <ItemStyle CssClass="rgRow" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"
                    Wrap="True" />
                <AlternatingItemStyle CssClass="rgAltRow" Font-Bold="False" Font-Italic="False"
                    Font-Overline="False" Font-Strikeout="False" Font-Underline="False"
                    HorizontalAlign="Left" Wrap="True" />
                <EditItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"
                    Wrap="True" />
            </MasterTableView>
    </telerik:RadGrid>


Thanks in advance.

Kind regards,

Dario
Dario Zanelli
Top achievements
Rank 1
 answered on 05 Feb 2010
1 answer
155 views
Hi, all!

I have a Tabstrip with some tab. I have a contextmenu also what I use for the right click on each tab (RadContextMenu's

ContextMenuControlTarget ControlID

 

property). But at one tab I do not want to show the ContextMenu.
My problem is that in the TabStrip's OnClientContextMenu event I can not cancel the contextmenu to open and in the ContextMenu's OnClientShowing event I do not know which tab triggerd the event so I can not cancel the desired event.
Any suggestion?

Thanks.

Yana
Telerik team
 answered on 05 Feb 2010
1 answer
155 views
I'm getting an error when I try to extend the RadTextBox using the ajax control toolkit PasswordStrength extender.

Is there any work-around already created for this?  Is this something that may be fixed in the future?

Extender control '' cannot extend 'txtPassword'. Extender controls of type 'AjaxControlToolkit.PasswordStrength' cannot extend controls of type 'Telerik.Web.UI.RadTextBox'.




Dimo
Telerik team
 answered on 05 Feb 2010
3 answers
298 views
Hi: Have you seen the NumericBox used by Microsoft Money 2007.
Its a good idea, it is a numeric box, when you press any operator key (+,-,*)
it drops down a calculator.

Best Regards
Darío K
Dimo
Telerik team
 answered on 05 Feb 2010
3 answers
309 views
In my Source Code file i have a Hyperlink control... Which i want to access and give the url from code behind. I did using the following method but it is giving me error.
Please help me... Its very urgent.

Its throwing an exception.
 
 <telerik:GridTemplateColumn HeaderText="Visit No." UniqueName="VisitNo" DefaultInsertValue=""> 
                              
                            <ItemTemplate> 
                                <asp:HyperLink ID="lblVisitNo" runat="server" Text='<%#Bind("SiteVisitNo") %>' ></asp:HyperLink> 
                            </ItemTemplate> 
                        </telerik:GridTemplateClumn>


 protected void gvRenewal_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        HyperLink lblVisitNo = (HyperLink)e.Item.FindControl("lblVisitNo"); 
        int SiteID = int.Parse(Request.QueryString["SID"]); 
        lblVisitNo.NavigateUrl = "~/Pages/Sites/Management_Sites/Renewal_SiteVisits.aspx?SID=" + SiteID; 
   
Princy
Top achievements
Rank 2
 answered on 05 Feb 2010
3 answers
158 views
The ScriptRegistrar.Render() method is throwing the exception: Specified file does not exist: "~/Scripts/jquery-1.4.js"

This is because I have upgraded to JQuery 1.4.1 .  What is my solution?
Atanas Korchev
Telerik team
 answered on 05 Feb 2010
3 answers
249 views
Hi,

I have a ASP.NET page with a RadAjaxManager and a UserControl ( uc1). The uc1 has another UserControl(uc2) inside. Is the there a way to trigger the uc2 to be updated using the RadAjaxManager from the main page?

Thank you,
Ruben.
Martin
Telerik team
 answered on 05 Feb 2010
3 answers
238 views
Hello,

I might be missing something obvious here, but server-side validation (i.e. Page.IsValid) fails for all my RadTextBox items when javascript is disabled.

 

<asp:ValidationSummary id="valSummary" runat="server" DisplayMode="BulletList" ShowSummary="true" />

 


 

<label for="txtStudentFirstName">First Name</label>

 

 

<telerik:RadTextBox ID="txtStudentFirstName" runat="server" CssClass="RadTextBox" MaxLength="30" />

 

<asp:RequiredFieldValidator id="rfvStudentFirstName" runat="server" ControlToValidate="txtStudentFirstName" ErrorMessage="First Name is required" Display="None" />

It seems as though the input value is not getting passed through. Could someone please shed some light on this...

Many thanks for any response.

Ryan Bartsch.
Dimo
Telerik team
 answered on 05 Feb 2010
1 answer
108 views
Hi,

I've a radgrid with scrolling enabled. I need to set the scroll height dynamically in he javascript in the onresize event.

how do i do this. I know scrolheight takes only pixels. I calculate my grid's height based on the formla:
(items.count * 24 ) + gridheaderheight.

Now the question is how can i access the scroll height in my javascript and set it to scroll height of radgrid in ascx. Pls help me with code.

When I get the scroll height fitting my screen, I shouldn't get the IE scrollbar? how do i do this
Tsvetoslav
Telerik team
 answered on 05 Feb 2010
7 answers
130 views
 I am facing one problem in RadGrid. After setting the FrozenColumnCount property, when I (horizontally) scrolled to the right end of the grid, it is leaving empty space (see the attach image). Here is the code which I am using.

<form id="form1" runat="server">
    <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
   
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true" Width="100%">
        <MasterTableView HeaderStyle-Width="80px"></MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" FrozenColumnsCount="2"></Scrolling>
            <Selecting AllowRowSelect="true" />   
        </ClientSettings>
    </telerik:RadGrid>
    </div>
    </form>

Code Behind is:

protected void Page_Load(object sender, EventArgs e)
    {
        RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
        RadGrid1.PreRender += new EventHandler(RadGrid1_PreRender);
        RadGrid1.ItemDataBound += new GridItemEventHandler(RadGrid1_ItemDataBound);
    }

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        //RadGrid1.MasterTableView.AutoGeneratedColumns[7].HeaderStyle.Width = Unit.Pixel(40);
        //RadGrid1.MasterTableView.AutoGeneratedColumns[10].HeaderStyle.Width = Unit.Pixel(40);
    }

    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {

    }

    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = GetResultsTable();
    }

    public DataTable GetResultsTable()
    {
        DataTable dt = new DataTable();

        for (int i = 0; i < 70; i++)
        {
            dt.Columns.Add("Column " + i);
            List<object> objectNumbers = new List<object>();

            for (int j = 0; j < 10; j++)
            {
                objectNumbers.Add(i.ToString() + "," + j.ToString());
            }

            while (dt.Rows.Count < objectNumbers.Count)
            {
                dt.Rows.Add();
            }

            for (int k = 0; k < 10; k++)
            {
                dt.Rows[k][i] = objectNumbers[k];
            }
        }
        return dt;
    }



I will really appreciate for quick response. Thanks

Best Regards,
M. Irfan
Dimo
Telerik team
 answered on 05 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?