Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
140 views
Hello!

I have some problems with validatng fields through radGrid/popup edit form. The fields to be validated are used in both 'Add' and 'Edit' popups, but validation works only in 'Add' form. Here is my approach. In ascx file:


<th>Amount:</th>
<td><asp:TextBox ID="txtAmount" runat="server" />
 
<asp:CustomValidator ID="ResourceValidator2" runat="server" Display="dynamic" ValidateEmptyText="true"
 ControlToValidate="txtAmount"
 ErrorMessage="Amount has to be entered and it has to be numeric value. "
  OnServerValidate="Validate_RealizationAmount" />
</td>

And on cs file the validation function:

protected void Validate_RealizationAmount(object source, ServerValidateEventArgs args)
       {
           double priceNum;
 
           if (txtAmount.Text == "" ||
               !double.TryParse(txtAmount.Text.Trim(), out priceNum))
           {
               args.IsValid = false;
           }
       }

Aditionally the ascx file is build in a way that the same file defines edit and add forms so that fields used in both are the same. So basically the submit is done by following button definitions:

<asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName='<%# DataItem is Telerik.Web.UI.GridInsertionObject ? "PerformInsert" : "UpdateEdited" %>'>
    <img style="border:0px;vertical-align:middle;" alt="" />
    <%# DataItem is Telerik.Web.UI.GridInsertionObject ? "Add" : "Update"%>
</asp:LinkButton>  
<asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll">
    <img style="border:0px;vertical-align:middle;" alt=""/>Peruuta
</asp:LinkButton>

So, basically when using the 'Add' popup the system prints an error text if the field is not valid, but doesn't do the same when using 'Edit'.  I don't know where to start digging. Help on this would be much appreciated.

-Sami
s
Top achievements
Rank 1
 answered on 21 Sep 2011
3 answers
160 views
Hi,

Can you tell me how to change rad grid row back color, height and selected item or focused row in css?

Thanks,
Princy
Top achievements
Rank 2
 answered on 21 Sep 2011
2 answers
128 views
Hi,

I'm using an own css file like this:

ContentAreaCssFile="~/App_Themes/Content.css"

That's all OK. But now, table borders (dotted borders for non-vosible table borders) aren't shown during editing and this is a real problem.
How can I use own style and the standard RadEditor styles for showing table borders ...

Do I need to refernce standard radeditor css file?

Please give me a little hint. It's urgent.

Kind regards!
Frank
Top achievements
Rank 1
 answered on 21 Sep 2011
2 answers
102 views
Hi,

I'm getting frustrated using Telerik RadGrid, i just create a simple page with 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
    <telerik:RadGrid ID="rg" runat="server" AutoGenerateColumns="false"
OnNeedDataSource="TestNeedDataSource">
        <MasterTableView  CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage"
            EditMode="PopUp" >
            <Columns>
                <telerik:GridBoundColumn DataField="Id" />
                <telerik:GridBoundColumn DataField="Name" />
            </Columns>
            <EditFormSettings PopUpSettings-Modal="true" PopUpSettings-Width="600"
                PopUpSettings-ScrollBars="Auto" PopUpSettings-Height="600"
                EditFormType="Template" >
                <FormTemplate>
                    <table>
                        <tr>
                            <td>Test</td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

And my code behind :

public IEnumerable<IDictionary> GenerateData()
    {
        for (var i = 0; i < 15; i++)
        {
            var dict = new Dictionary<string, object>();
            dict["ID"] = Guid.NewGuid();
            dict["Name"] = "Name_" + i;
            yield return dict;
        }
    }
    protected void TestNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        rg.DataSource = GenerateData().ToDataSource();
    }

Every time i click Add New Record, it call the ajax loading panel, but it doesn't open my popup modal. It does nothing.

Is there anything wrong with my code ? Or is it impossible to do this kind of binding with RadGrid ?

Thanks in advance
Al
Top achievements
Rank 1
 answered on 21 Sep 2011
3 answers
69 views
I have added some of the columns in grid at run time and some at design time.Sorting is not working on some of the columns and on clicking those columns the entire grid gets disappears and filtering is not at all working.
Shinu
Top achievements
Rank 2
 answered on 21 Sep 2011
5 answers
106 views
i have added all columns at runtime. as well delete and edit as gridbutton columns..i m able to open a file on clicking delete but not able
 to delete..
following is the code
  gbtc = new GridButtonColumn();
            gbtc.HeaderText = "Delete";
            gbtc.UniqueName = "ibtnDelete";
            gbtc.ImageUrl = "~/App_Themes/Bari_Default/images/delete_ico.png";
            gbtc.ButtonType = GridButtonColumnType.ImageButton;
            gbtc.CommandName = "Delete";
            gbtc.Visible = false;
            gbtc.FilterImageToolTip = "";
            rgdProcedureMaster.MasterTableView.Columns.Add(gbtc);


do i need to add more information for it to get done
Shinu
Top achievements
Rank 2
 answered on 21 Sep 2011
1 answer
131 views
Where do I change the text "No records to display." In The FileExplorer Grid to the Swedish text?
Princy
Top achievements
Rank 2
 answered on 21 Sep 2011
1 answer
101 views
Hello,

Please have a look at the following code:

<telerik:GridTemplateColumn HeaderText="Update" ItemStyle-Width="8%">
    <FilterTemplate>
        <div class="filter-wrapper">
            <div>
                <telerik:RadComboBox runat="server" ID="ddlUpdateFilter" AutoPostBack="true"
                    OnSelectedIndexChanged="ddlUpdateFilter_SelectedIndexChanged" MarkFirstMatch="true"
                    AllowCustomText="true" ShowToggleImage="false" Width="70px">
                </telerik:RadComboBox>
                <img src="../Resources/Common/filter.png" runat="server" id="imgUpdateFilter"
                    alt="filter" />
                <asp:ImageButton runat="server" ID="imgClearUpdateFilter" ImageUrl="~/Resources/Common/clear-filter.gif"
                    CommandName="ClearFilter" />
            </div>
        </div>
    </FilterTemplate>
    <ItemTemplate>
        <asp:CheckBox runat="server" ID="chkEdit" Enabled="false" />
    </ItemTemplate>
</telerik:GridTemplateColumn>

 I have a TemplateColumn in which I'm using FilterTemplate to apply filter on this column. The functionality is working fine in IE but when I open my page on Firefox or Chrome, all the columns having FilterTemplate become so wide that the grid blows off the page to the right. Once I write AllowFiltering="false" for that column, the column width comes back but obviously filtering is gone too.

A quick response in this regard will be highly appreciated.

Thanks.

~Ahmed
Marin
Telerik team
 answered on 21 Sep 2011
1 answer
102 views
Hi there,

I have a Rad Ajax Grid in which I'm dynamically adding pagesize values for the pagesize combobox.
When loading, I'm retrieving a user's preferred page size and applying this to the grid.
When the pagesize is changed I would like to save the new size to a database but I'm having a problem.

At the moment I know the PageSizeChanged event is being fired by showing an alert, but a function I'm calling to write the value back to the database doesn't seem to be called.
If I place an alert before and after my function they both fire.   I know the function works because I'm using it elsewhere on the page (i.e. if there's not value set, I write a default etc).

Can anyone offer any suggestions as to why this is causing a problem?

Cheers
Rich
Marin
Telerik team
 answered on 21 Sep 2011
3 answers
154 views
Hi,

I'm having problems exporting from a filtered gridcontrol. Whenever I apply a filter, it is applied perfectly on the webinterface, but exporting to .pdf format seems to ignore the filter, resulting in a full list of the datasource in the pdf file.

I've spent half a day reading through your forums, and tried every relevant course, without any luck. I've noticed that most of these, are not using OnNeedDataSource as datasource, could my problem be here?

I would be happy to supply code snippets, but as I have tried at least 10 different things with no success, I don't think my problem lies in the export itself.

I am not doing anything custom with the filtering, but it seems like the MasterTableView has forgotten its filtering, once the pdf event is fired. Should I be doing anything to ensure that the filter persists?

Any and all help would be much appreciated - and if you need additional info I'll supply it ASAP :)
Jakob
Top achievements
Rank 1
 answered on 21 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?