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

I have 2 questions

1) We are using a grid where users can pick the columns that display. As a result the grid width can get very wide and break out of the page. See http://www.creditbootcamp.com/grid_problem.png

Is there a way we can have a horizontal scroll bar automatically appear if it breaks the container? The layout is liquid and uses percentages so we cannot assign any fixed width values. The grid is in a table <TD></TD> which is set at 75% width.
Here is the top grid code (excluding the GridTemplateColumns):

<ds:DisputeGrid ID="CustomerSearchResults" EnableAjaxSkinRendering="True" EnableRowHover="True" runat="server" Skin='<%#Me.TelerikSkin %>' OnNeedDataSource="CustomerSearchResults_NeedDataSource" AllowSorting="true" EnableViewState="true" AllowCustomPaging="true" OnItemDataBound="CustomerSearchResults_ItemDataBound" OnInit="CustomerSearchResults_Init"

What I would like is for a horizontal scroll bar to automatically appear if it breaks the container.

2) My second question is how do you prevent wrapping of items in the grid. When the grid has lots of columns it causes the icons to wrap.
See http://www.creditbootcamp.com/grid_tools.png

We tried:   
<rad:GridTemplateColumn UniqueName="Tools" HeaderText="Tools" ItemStyle-Width="150">
But it did not work. Putting the icons in a table did work but caused borders to show up around the table (which we dont want).

Thanks guys!!

Dimo
Telerik team
 answered on 05 Aug 2009
1 answer
196 views
    <telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" 
                    AutoGenerateColumns="False" AllowFilteringByColumn="True" 
                    ShowStatusBar="True" OnUpdateCommand="RadGrid1_UpdateCommand"  
                    OnInsertCommand="RadGrid1_InsertCommand" 
                    OnDeleteCommand="RadGrid1_DeleteCommand"  
                    OnNeedDataSource="RadGrid1_NeedDataSource"  
                    OnItemDataBound="RadGrid1_ItemDataBound"  
                    ShowFooter="True" Skin="Vista" onitemcommand="RadGrid1_ItemCommand"
                     
                    <MasterTableView DataKeyNames="MuhFisDetayId" AllowMultiColumnSorting="True" 
                        CommandItemDisplay="Top" EditMode="InPlace" InsertItemDisplay="Top"
                        <Columns> 
                             <telerik:GridDropDownColumn DataField="HesapId" DataSourceID="LLBLGenProDataSource3" 
                                HeaderText="HesapKodu" ListTextField="HesapKodu" ListValueField="HesapId" UniqueName="HesapId"
                                <ItemStyle HorizontalAlign="Left" Width="160px" /> 
                             </telerik:GridDropDownColumn> 
                             
                             <telerik:GridTemplateColumn HeaderText="Açıklama" UniqueName="TemplateColumnAciklama" EditFormColumnIndex="1"
                                <ItemTemplate> 
                                    <%# Eval("Aciklama")%> 
                                </ItemTemplate> 
                                 
                                <EditItemTemplate> 
                                    <telerik:RadTextBox runat="server" ID="tbAciklama"   DataType="Decimal"  
                                        Text='<%# Bind("Aciklama") %>' Width="180px"
                                    </telerik:RadTextBox> 
                                </EditItemTemplate> 
                                
                                <FooterTemplate> 
                                <asp:Label runat="server" ID="lblFooterAciklama" Text=" Toplam Borç - Alacak " Font-Bold="true" Font-Names="Verdana" ForeColor="#000000"></asp:Label> 
                                </FooterTemplate> 
                                <ItemStyle HorizontalAlign="Left" Width="200" Wrap="true"/> 
                           </telerik:GridTemplateColumn> 
                             
                            <telerik:GridTemplateColumn HeaderText="Borç" UniqueName="TemplateColumnBorc" EditFormColumnIndex="1"
                                 
                                <ItemTemplate> 
                                    <%# Eval("Borc" )%> 
                                </ItemTemplate> 
                                 
                                <EditItemTemplate> 
                                   <telerik:RadNumericTextBox runat="server" ID="tbBorc" Width="40px" DbValue='<%# Bind("Borc")  %>' DataType="Decimal"
                                   <ClientEvents OnKeyPress="onKeyPresstbBorc" /> 
                                   </telerik:RadNumericTextBox> 
                                </EditItemTemplate> 
                                 
                                <FooterTemplate> 
                                <asp:Label runat="server" ID="lblBorcToplam" Text="" Font-Bold="true" Font-Names="Verdana" ForeColor="#000000"></asp:Label> 
                                </FooterTemplate> 
                                 
                              <ItemStyle HorizontalAlign="Left" Width="120px" /> 
                            </telerik:GridTemplateColumn> 
                                  
                            <telerik:GridTemplateColumn HeaderText="Alacak" UniqueName="TemplateColumnAlacak" 
                                EditFormColumnIndex="2"
                                 
                                <ItemTemplate> 
                                    <%# Eval("Alacak")%> 
                                </ItemTemplate> 
                                 
                                <EditItemTemplate> 
                                    <telerik:RadNumericTextBox runat="server" ID="tbAlacak" Width="40px" DbValue='<%# Bind("Alacak")  %>' DataType="Decimal"
                                    <ClientEvents OnKeyPress="onKeyPresstbAlacak" /> 
                                    </telerik:RadNumericTextBox> 
                                </EditItemTemplate> 
                                 
                                <FooterTemplate> 
                                 <asp:Label runat="server" ID="lblAlacakToplam" Text="" Font-Bold="true" Font-Names="Verdana" ForeColor="#000000"></asp:Label> 
                                </FooterTemplate> 
                                 
                                 
                              <ItemStyle HorizontalAlign="Left" Width="120px" /> 
                            </telerik:GridTemplateColumn> 
                             
                            <telerik:GridEditCommandColumn UpdateText="Kaydet" UniqueName="EditCommandColumn"  
                                CancelText="İptal" EditText="Güncelle"
                              <ItemStyle HorizontalAlign="Center" Width="100" /> 
                         </telerik:GridEditCommandColumn> 
                         <telerik:GridButtonColumn   UniqueName="DeleteColumn" Text="Sil" CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Bu Kaydı Silmek Ä°stediÄŸinizden Eminmisiniz" ItemStyle-Width="50" ItemStyle-HorizontalAlign="Center" /> 
                         </Columns> 
                         <EditFormSettings CaptionFormatString="{0} nolu FiÅŸi Güncelleme" CaptionDataField="MuhFisDetayId"
                            <EditColumn ButtonType="ImageButton" /> 
                            <FormStyle BackColor="#eef2ea" Width="100%" /> 
                            <FormTableStyle CellPadding="2" CellSpacing="0" GridLines="None" /> 
                            <FormTableItemStyle Height="29px" Width="100%" /> 
                         </EditFormSettings> 
                    </MasterTableView> 
                    
                    <ClientSettings>  
                        <ClientEvents OnRowCreated="onRowCreated" OnRowCreating="onRowCreating" OnRowDblClick="RowDblClick" OnCommand="onCommand" /> 
                    <Selecting AllowRowSelect="true" /> 
                    </ClientSettings> 
                </telerik:RadGrid> 


In grid there is two column (TemplateColumnBorc , TemplateColumnAlacak) Which has RadNumericTexBox in Edit and İnsert mode .
İ want to make "0" the value of others radnumerictextbox when i write something in one of them .

İn Edit Mode İ accomplish it  with Javascript

                       var currentRowIndex = null;                
 
                        function onCommand(sender, args) 
                        {          
                                 if(args.get_commandName()== 'Edit')  
                                 {     
                                   currentRowIndex = args.get_commandArgument();  
                                 } 
                        }   
                         
                        function onKeyPresstbBorc(sender, eventArgs) 
                        { 
 
                          var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();  
                          var dataItem = masterTable.get_dataItems()[currentRowIndex]; 
                          var radTextBox1 = dataItem.findControl("tbAlacak"); 
                          radTextBox1.set_value(0.00); 
                        }
                       
                        function onKeyPresstbAlacak(sender, eventArgs)
                        {
                          var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();
                          var dataItem = masterTable.get_dataItems()[currentRowIndex];
                          var radTextBox1 = dataItem.findControl("tbBorc");
                          radTextBox1.set_value(0.00);
                        }

But When İ Click "Add new row" a new row creating on grid  inlinemode .

i want to accomplish make 0 value of other radcombobox when i write something one of them  before Performinsert .



































Yavor
Telerik team
 answered on 05 Aug 2009
1 answer
296 views
Hi there

For some reason the tooltip on telerik:GridButtonColumn and on telerik:GridEditCommandColumn
do not show, is there something i need to do for it to show thanks

here is my code

<

 

telerik:RadGrid ID="radCategory" runat="server" DataSourceID="dsCategory"

 

 

 

Skin="Vista" GridLines="None" Width="700px" Height="500px"

 

 

 

AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True">

 

 

 

<GroupingSettings CaseSensitive="false" />

 

 

 

<MasterTableView AutoGenerateColumns="False" DataSourceID="dsCategory" EditMode="InPlace"

 

 

 

CommandItemDisplay ="Top" AllowAutomaticUpdates="true" DataKeyNames="CategoryId"

 

 

 

AllowAutomaticInserts="true" AllowAutomaticDeletes="true">

 

 

 

<CommandItemTemplate>

 

 

 

<div style="padding:10px 0px;">Course Category&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkAddNew" runat="server" CommandName="InitInsert" Visible="True">

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/add.gif" /> Add new Category</asp:LinkButton>&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkExportExcel" runat="server" CommandName="ExporttoExcel" >

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/Excel.gif" /> Export To Excel </asp:LinkButton>&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkExportWord" runat="server" CommandName="ExporttoWord" >

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/Word.gif" /> Export To Word </asp:LinkButton>&nbsp;&nbsp;

 

 

 

<asp:LinkButton ID="lnkRefresh" runat="server" CommandName="RebindGrid">

 

 

 

<img style="border:0px;vertical-align:middle;" alt="" src="../Images/Refresh.gif" /> Refresh</asp:LinkButton>

 

 

 

</div>

 

 

 

</CommandItemTemplate>

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="CategoryId" DataType="System.Guid"

 

 

 

EmptyDataText="&amp;nbsp;" HeaderText="CategoryId" SortExpression="CategoryId"

 

 

 

UniqueName="CategoryId" ReadOnly="true" Visible="False">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Name" EmptyDataText="&amp;nbsp;"

 

 

 

HeaderText="Name" SortExpression="Name" UniqueName="Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Description" EmptyDataText="&amp;nbsp;"

 

 

 

HeaderText="Description" SortExpression="Description" UniqueName="Description" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton"

 

 

 

CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">

 

 

 

<HeaderStyle Width="20px" />

 

 

 

<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />

 

 

 

</telerik:GridButtonColumn>

 

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" >

 

 

 

<ItemStyle CssClass="MyImageButton" />

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">

 

 

 

<Selecting AllowRowSelect="True" />

 

 

 

</ClientSettings>

 

 

 

<FilterMenu EnableTheming="True">

 

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

 

</FilterMenu>

 

 

 

</telerik:RadGrid>

 

 

Princy
Top achievements
Rank 2
 answered on 05 Aug 2009
0 answers
81 views
I M Facing Some problems while setting the width of RadComboboxes.
I Also use RadAjaxloading Panel

Scenario is ..I have two RadComboboxes ..placed aside on selection of one other combobox has to be filled.
when i execute the page two radcomboboxes appear in two Different Lines...Both of which width is 25%....

I tried setting the absolute width 35px it worked...pls give me any solution about relative width.
Ashwin Deshpande
Top achievements
Rank 1
 asked on 05 Aug 2009
3 answers
122 views
Hi

New to these controls. I'm having trouble extracting the values from the text boxes that appear when using inplace editing.

I've got to the rgArea_InsertCommand( ) sub but how do I get the values from the control?

Andy G
Princy
Top achievements
Rank 2
 answered on 05 Aug 2009
1 answer
137 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
123 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
99 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
121 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
100 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?