Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
141 views
Hi there,

I'm just evaluating Rad Controls for ASP.NET
I have some question about validation model in RadGrid.
Does it offer something richer than ASP.NET style validation?
I think ASP.NET validation does not answer the real-life applcation.
You just don't validate that this field should less than this or that.
In real application we sometimes need to validate data cross fields
and under some certain conditions.
I see in the Validation section of RadGrid in Demo and found that
you just use System.Web.UI.WebControls.ServerValidateEventArgs class
which is too lame to me. Is there another validation model to use than that.
Or we just need to code a sequence of IF THEN ELSEIF to validate data item
on Insert, Update, DeleteCommand?

Thanks
Panya
Yavor
Telerik team
 answered on 05 Aug 2009
1 answer
126 views
 I am grouping on a column called Category and have a Edit button that is automatically generated for each item. When the user first loads the page all groups should be collapsed. I can get this to work by setting the GroupDefaultExpanded property. However after setting this property when I click Edit  my edit form no longer works. It appears that the Edit command fires but the all the groupings collapse and hide it.

How do set all groupings to initial start as collapsed but for a row to maintain its expanded state when the Edit link is selected?

Thanks,

Kyle
Princy
Top achievements
Rank 2
 answered on 05 Aug 2009
1 answer
105 views
Hi,

I have a grid and for some of the columns i have used custom filter templates.
When i worked on this grid, I ended up writing custom filter logic and i used the following code

          If e.CommandName = radGrid.FilterCommandName Then
                e.Canceled = True
                Filter()
            End If
In the Filter () function i build a filter expression and assign it to the grid.

What i want to know is , do i have to have use custom filter logic if i use custom filter templates?


PS
Princy
Top achievements
Rank 2
 answered on 05 Aug 2009
3 answers
125 views

 

Hi,

I  need the selected text of a dropdown control's value to be pasted in my radeditor

how is it possible. can u help me with the code.
So, based on the selected value from a dropdownlist, that selcted value gets pasted in my radeditor depending on my cursor position.
I'm using the pastehtml method.

Give me some egs of how to insert the raddropdownlist's selected value which is a separate ctrl and take that text and paste it  in the radeditor depending on it's caret/cursor position.
pls do help me with code

Thanks,
ZR
Georgi Tunev
Telerik team
 answered on 05 Aug 2009
1 answer
106 views
Hi,

I've a radgrid with 2 columns one is  a gridbound col and other is a gridtemplate column.
These columns have been declared in my .ascx (design side).
Now, I need to get the grid headers when the radgrid has no items(rows) in it. So, how do i implement this??

So, how do i get the header names atleast when the grid is empty???
Thanks,
ZR
Princy
Top achievements
Rank 2
 answered on 05 Aug 2009
1 answer
169 views
Again, couldn't find anything via search so...

I have a grid that seems to be overriding the sort order that I'm specifying in the data source's SelectCommand.  The table I'm trying to display has three columns; ID, Name, and DisplayOrder.  ID is the primary key on the table and is a char(3) SQL data type.  I am trying to sort the grid by: "DisplayOrder, Name" but no matter what I try, the grid is sorted by ID.  I've tried using a stored procedure in the SelectCommand, setting the DataKeyNames to "DisplayOrder, ID", and various combinations of Grid and MasterTableView properties to no avail.

Seems simple enough, but I can't figure it out.  Can someone help?

Thanks,

Jay

Grid declaration:
<telerik:RadGrid ID="ListGrid" 
    Skin="Hay" 
    AllowAutomaticDeletes="True" 
    AllowAutomaticInserts="True" 
    AllowAutomaticUpdates="True" 
    AutoGenerateColumns="false" 
    DataSourceID="SQLDataSource" 
    OnItemDataBound="ListGrid_ItemDataBound" 
    OnItemInserted="ListGrid_ItemInserted" 
    OnItemUpdated="ListGrid_ItemUpdated" 
    OnItemDeleted="ListGrid_ItemDeleted" 
    runat="server">  
      
    <ValidationSettings EnableValidation="true" /> 
      
    <MasterTableView  
        DataSourceID="SQLDataSource" 
        DataKeyNames="DisplayOrder, ID" 
        CommandItemDisplay="Top" 
        CommandItemSettings-AddNewRecordImageUrl="~/_Images/GIF/16x16/Add.gif" 
        CommandItemSettings-AddNewRecordText="Add pet type" 
        CommandItemStyle-HorizontalAlign="Left" 
        EditMode="InPlace" 
        AutoGenerateColumns="false">  
          
        <SortExpressions> 
            <telerik:GridSortExpression FieldName="DisplayOrder" SortOrder="Ascending" /> 
            <telerik:GridSortExpression FieldName="Name" SortOrder="Ascending" /> 
        </SortExpressions> 
 
        <NoRecordsTemplate> 
            <div style="padding-top:10px;padding-bottom:10px;padding-left:20px;">  
                <asp:Label ID="NoItemsLabel" 
                    Text="There are no items to show in this view." 
                    runat="server" /> 
            </div> 
        </NoRecordsTemplate> 
          
        <Columns> 
            <telerik:GridTemplateColumn UniqueName="LeftSpacer" 
                HeaderStyle-Width="6" 
                ItemStyle-Width="6">  
                <HeaderTemplate> 
                    &nbsp;  
                </HeaderTemplate> 
            </telerik:GridTemplateColumn> 
              
            <telerik:GridBoundColumn UniqueName="ID" 
                HeaderText="ID" 
                HeaderStyle-Width="50" 
                ItemStyle-VerticalAlign="Top" 
                ItemStyle-Width="50" 
                DataField="ID" /> 
              
            <telerik:GridBoundColumn UniqueName="Name" 
                HeaderText="Name" 
                HeaderStyle-Width="150" 
                ItemStyle-VerticalAlign="Top" 
                ItemStyle-Width="150" 
                DataField="Name" /> 
              
            <telerik:GridBoundColumn UniqueName="DisplayOrder" 
                HeaderText="Display Order" 
                HeaderStyle-Width="100" 
                ItemStyle-VerticalAlign="Top" 
                ItemStyle-Width="100" 
                DataField="DisplayOrder" /> 
 
            <telerik:GridEditCommandColumn UniqueName="Edit" 
                ButtonType="ImageButton" 
                EditImageUrl="~/_Images/GIF/16x16/Edit.gif" 
                ItemStyle-Width="50" /> 
                  
            <telerik:GridButtonColumn UniqueName="Delete"   
                ButtonType="ImageButton" 
                CommandName="Delete" 
                Text="Delete" 
                ConfirmText="Delete this pet type?" 
                ConfirmTitle="Delete Pet Type" 
                ImageUrl="~/_Images/GIF/16x16/Delete.gif" /> 
                  
            <telerik:GridTemplateColumn UniqueName="RightSpacer" 
                HeaderStyle-Width="6" 
                ItemStyle-Width="6">  
                <HeaderTemplate> 
                    &nbsp;  
                </HeaderTemplate> 
            </telerik:GridTemplateColumn> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 
 

DataSource declaration:
<asp:SqlDataSource ID="SQLDataSource" 
    ConnectionString="<%$ ConnectionStrings:MainConnectionString %>" 
    ProviderName="System.Data.SqlClient" 
    InsertCommand="INSERT INTO [dbo].[PetType] (ID, Name, DisplayOrder) VALUES (UPPER(@ID), @Name, @DisplayOrder)" 
    SelectCommand="SELECT [ID], [Name], [DisplayOrder] FROM [dbo].[PetType] ORDER BY [DisplayOrder], [Name]" 
    UpdateCommand="UPDATE [dbo].[PetType] SET [ID] = UPPER(@ID), [Name] = @Name, [DisplayOrder] = @DisplayOrder WHERE [ID] = @original_ID" 
    DeleteCommand="DELETE FROM [dbo].[PetType] WHERE [ID] = @original_ID" 
    OldValuesParameterFormatString="original_{0}" 
    ConflictDetection="CompareAllValues" 
    runat="server">  
      
    <InsertParameters> 
        <asp:Parameter Name="ID" Type="String" /> 
        <asp:Parameter Name="Name" Type="String" /> 
        <asp:Parameter Name="DisplayOrder" Type="Int32" /> 
    </InsertParameters> 
      
    <UpdateParameters> 
        <asp:Parameter Name="ID" Type="String" /> 
        <asp:Parameter Name="Name" Type="String" /> 
        <asp:Parameter Name="DisplayOrder" Type="Int32" /> 
        <asp:Parameter Name="original_ID" Type="String" /> 
    </UpdateParameters> 
      
    <DeleteParameters> 
        <asp:Parameter Name="original_ID" Type="String" /> 
    </DeleteParameters> 
</asp:SqlDataSource> 
 
Jay Legere
Top achievements
Rank 1
 answered on 05 Aug 2009
3 answers
282 views
Hi, I have seen examples for totaling a column and having it display in the footer, but I would also like to be able to add an extra column to the grid that displays a total for the row. Is this possible?

I have 2 different scenarios. The first scenario is that I will autogenerate the columns for the grid and I would like to be able to add an extra column to the grid for which I will total the row across (maybe skipping the first or second column). In the second scenario I would build a dynamic grid and would add the extra column myself.

I am binding the grid to data coming from sql server but I can't add the extra computation on the sql server side.

Are there any examples for this and can it be done? Thanks in advance.



kachy
Top achievements
Rank 1
 answered on 04 Aug 2009
1 answer
188 views
I am tyring to create a report with autogenerated Radgrid and adding a Calculatedcolumn for row total. If the columns are declared in design mode and I use EnableLinqExpressions false, filter for DateTime and the calculated column works but for autogenerated columns - I get following error for DateTime filter and Calculated Column filter.

For DateTime filter:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

For GridCalculated Column the error is:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Expression of type 'System.Nullable`1[System.Int32]' cannot be used for parameter of type 'System.Object' of method 'System.String ToString(System.Object)'


Can you please suggest what can I do to fix that error.

Thanks.
kachy
Top achievements
Rank 1
 answered on 04 Aug 2009
2 answers
93 views
Hello,

I had my RadGrid with DataSourceID - from Database. The data displays fine.
 My original goal is delete the recod on the server and I noticed the sample from Help.

<telerik:RadGrid id="RadGrid1" runat="server" OnDeleteCommand="RadGrid1_DeleteCommand"
OnNeedDataSource="RadGrid1_NeedDataSource">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="CustomerID">
   
<Columns>
  ........
When I tried to use that, the application never fires OnNeedDataSource event, 
so my Grid is always empty .

Did I missed something or this code sample is not complete.

Please help
Coty
Top achievements
Rank 1
 answered on 04 Aug 2009
3 answers
494 views
Hi,

I have a RadTreeView control inside the RadCombobox's  <Item Template>
Now I need to databind the RadTreeView from the code behind. How can I access the this control from the code behind?

Any help will be greatly appreciated.

<telerik:RadComboBox ID="RadComboBoxCategoryLevels"
                         Width="160px"
                         Height="300px"
                         AllowCustomText="false"
                         runat="server" >
                        <ItemTemplate >
                            <div onclick="StopPropagation(event)">
                                <telerik:RadTreeView ID="RadTreeView"
                                                     runat="server"
                                                     OnClientNodeClicking="OnclientNodeClickingHandler">
                                                     <DataBindings >
                                                        <telerik:RadTreeNodeBinding Depth="0" Expanded="true" />
                                                     </DataBindings>                                                     
                                </telerik:RadTreeView>
                            </div>                            
                        </ItemTemplate>                     
    </telerik:RadComboBox>
venm
Top achievements
Rank 1
 answered on 04 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?