Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
149 views

This code isn't firing the custom validator's ServerValidate event for my GridDropDown column.  The exact same code works fine if I hook it into a standard GridBoundColumn with an underlying TextBox control and the necessary underlying control type changes.

 

protected void dtgFields_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem item = e.Item as GridEditableItem;

            GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)item.EditManager.GetColumnEditor("EDocFieldTagCtl");
            TableCell cell = (TableCell)editor.ComboBoxControl.Parent;

            CustomValidator validator = new CustomValidator();
            validator.ControlToValidate = editor.ComboBoxControl.ID;
            validator.ErrorMessage = "testing custom validator";
            validator.Display = ValidatorDisplay.Dynamic;
            validator.ServerValidate += new ServerValidateEventHandler(tagvalidate);
            cell.Controls.Add(validator);
        }
    }

Bob
Top achievements
Rank 1
 asked on 07 Feb 2017
0 answers
162 views

I have the following scenario

Id Name UniqueId Country   City

1  xyz    abc123     UK        London

2 xyz      abc123    UK     Leeds

3 nop     tty123     USA         Dallas

4 nop     tty123     USA        Boston

5 bob     ght334   Canada   Ottawa

6 smith  ryh123    USA

7 smith ryh123     Canada

 

I want to merge the rows and show the list and represent it in the Radgrid with filtering and sorting

1 xyz    abc123     UK        London, Leeds
2 nop     tty123     USA         Dallas, Boston
3 bob     ght334   Canada   Ottawa

4 smith  ryh123    USA ,Canada

 

 

 

 

binny
Top achievements
Rank 1
 asked on 06 Feb 2017
0 answers
207 views

Hi All,

I have a radnumerictextbox within a grid. When this value is changed in edit mode, i want to perform some calculations.

I keep getting object reference not set to a instance on this line as well as the one after that.

  famIncome = Convert.ToDouble(((RadNumericTextBox)dataItem.FindControl("rntxtAnnualIncome")).Value );

Not sure what i am missing here.

Let me know how to get those values.

 

 

protected void rntxtAnnualIncome_TextChanged(object sender, EventArgs e)
    {
        foreach (GridDataItem dataItem in rg_ProgramApp.EditItems )
        {
            double famIncome;
            int famMembers;
            famIncome = Convert.ToDouble(((RadNumericTextBox)dataItem.FindControl("rntxtAnnualIncome")).Value );
            famMembers = Convert.ToInt32(((RadNumericTextBox)dataItem.FindControl("rntxtFamilymembers")).Text);
        }
    }
 
 
<telerik:GridTemplateColumn UniqueName="FamilyMembers" HeaderText="FamilyMembers">
    <ItemTemplate>
    <asp:Label runat="server" ID="lblFamilyMembers" Text='<%# Bind("FamilyMembers") %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <telerik:RadNumericTextBox runat="server" ID="rntxtFamilymembers"   DbValue='<%# Bind("FamilyMembers") %>'
     MaxValue="20" NumberFormat-DecimalDigits="0" ></telerik:RadNumericTextBox>
    </EditItemTemplate>
    </telerik:GridTemplateColumn>
 
<telerik:GridTemplateColumn UniqueName="AnnualIncome" HeaderText="Annual Income">
    <ItemTemplate>
    <asp:Label runat="server" ID="lblAnnualIncome" Text='<%# Bind("AnnualIncome") %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <telerik:RadNumericTextBox runat="server" ID="rntxtAnnualIncome" Value='<%# Bind("AnnualIncome") %>'
    Type="Currency" NumberFormat-DecimalDigits="2" OnTextChanged="rntxtAnnualIncome_TextChanged" AutoPostBack="true" ></telerik:RadNumericTextBox>
    </EditItemTemplate>
    </telerik:GridTemplateColumn>

 

Thanks in Advance

Jagat
Top achievements
Rank 1
 asked on 06 Feb 2017
0 answers
101 views

 I have a radgrid that uses Add New Record to enter data, then uses the server side validation to make sure that the User Id field is not duplicated in the database.  When the server side validation fails, I display a message why the insert failed. To keep the insert mode, I use e.Canceled but values are lost.
 I can't figure out how to keep the values in the textboxes after the server validation fails so the user won't have to retype everything. 

Thanks in advance.

Priya
Top achievements
Rank 1
 asked on 06 Feb 2017
3 answers
273 views

Hi,

I'm exporting my grid to Excel in Biff method.

I ssucessfully added background colors to the headers but I don't get to set borders on the cells of the excel export.

How can I achieve this ?

Eyup
Telerik team
 answered on 06 Feb 2017
0 answers
128 views

Hi

I want to show progressbar on radgrid while loading data, in need data source function data loading sql query contain brings a lot of data so i want to show progress of loading process instead of simply showing busy indicator with RadLaodingPanel. Is there any way we can do this ? 

Regards,

Zain

Zain
Top achievements
Rank 1
 asked on 06 Feb 2017
0 answers
96 views

I have a radGrid in which one column has some text in English language. Now I have implemented google translation on my website and I have changed the language of my website by google translation to other language.

But when I try to get that column data from code behind in selected language it won’t work, I get the text in English language.

How can I get the content in selected language in code behind?

SURYA
Top achievements
Rank 2
 asked on 06 Feb 2017
0 answers
66 views

Hello

Could You help me How can I get correct currentpageindex and Itemindex after filtering?

When I filter Grid column my Itemindex and currentpageindex Missed.

Thanks for your help

bahar kashani
Top achievements
Rank 1
 asked on 05 Feb 2017
15 answers
753 views
Hi,
I have a radGrid with an attachment column visible only in form edit mode. The attachment is saved in a folder not in the db.
I would like to generate an hyperlink when an attachment is loaded and place it somewhere in the edit form of the record so that the user can simply click on the link and visualize the attachment.
The user may load more than one attachment so every time a new one is loaded, a new link should be generated.
How can I do something like that? I am completely lost on this one!

I think I should set the DataNavigateUrlFields of the dynamically generated attachmentcolumn to the path/filename of the new loaded/selected file. But I do not know how to get such url.
Moreover how do I generate dynamically a new column every time I load a new file pointing to such url?



Thanks
Olanrewaju
Top achievements
Rank 1
 answered on 04 Feb 2017
0 answers
207 views

1. I am trying to add validate a textbox with Custom Validator in the Add New Record mode for a radgrid. The server validate method is called on Insert button click rather than lost focus for the textbox.

2. I want to keep the radgrid in insert mode if validation fails. e.Canceled = true keeps the grid in Insert mode but the user entered values are lost. How can I keep the user entered values in the insert mode if custom validation fails?

 

Thanks

Priya
Top achievements
Rank 1
 asked on 04 Feb 2017
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?