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

System: ASP.NET AJAX v2012.1.215.40
Visual Studio 2010

We use DatasourceID property and the ShowInsertItem() function of RadListView to display at the same time the data by  <ItemTemplate> and the insertion by <InsertItemTemplate>. Everything works fine, except when the data are empty. In this case, the content of <EmptyDataTemplate> isn't displayed if ShowInsertItem() is used.
If the <ItemTemplate> can be displayed at the same time that <InsertItemTemplate>, the display of
<EmptyDataTemplate> should follow the same logic.

Is there an option to force the display of <EmptyDataTemplate> while the <InsertItemTemplate> is showed?

Best regards,
Alain
Tsvetina
Telerik team
 answered on 30 Mar 2012
0 answers
107 views
I am trying to find a solution when user is trying to search for a item and cannot be found. it will return to first item. 
When the first item is selected, the cursor is at the end of selected text. Is there any way that when the user start search for next item, it will just clear the selected text. maybe there is a way to highlight the selected text so it will get clear when user start typing?

thanks
function RadComboBlur(source, args) {
var oval = source.get_text();
if (oval != source.get_selectedItem().get_text()) {
var digit = source.get_items().getItem(0).get_value().length;
var val = $.strPad(oval, digit);
var item = source.findItemByValue(val);
if (item) {
item.select();
} else {
if (oval == "") {
alert("Value cannot be empty. Default value is selected instead.");
}else{
alert("Input value does not exists. Default value is selected instead."); 
}
           var item = source.get_items().getItem(0);
           item.select();            
}                        
}
}
charles
Top achievements
Rank 1
 asked on 30 Mar 2012
1 answer
92 views
Hi,
I have a RadSplitter Control in an aspx page wich contains two RadPanes.The RadPanes Content is loaded from an external source (still pages from my project) thanks to the contentURL property. The rightpane content is loaded dynamically from an event of the leftpane ( a searchbutton click and a node click from a RadTreeView).

In this scenario i would like the content inside the RightPane to be loaded with Ajax.

I read in this forum that in this case, the only way to make it work would be to make an update of the whole RadSplitter.
So i've tried to find a way to programmatically add in the page_load event handler an ajaxsetting to the RadAjaxManager with the RadAjaxPanel where the treeview is embedded as initiator to update the RadSplitter which is in the parent page.

The problem i have is that  i can't get the reference of the splitter control from that parent page server side, i've already figured out how to get the reference client side with javascript but the AjaxSettings.AddAjaxSetting server method only accept the server object references as parameters.

Is there a way to achieve this or am i going the wrong way, will this work ?

Thank you
Dobromir
Telerik team
 answered on 30 Mar 2012
4 answers
144 views

                Hi! We’re redesigning our web-site and replacing all our current menus and grids with your RadMenu and RadGrid.  I’ve been running into a problem with the appearance of the menu, though. Even though the menu item text looks like it fits within the menu’s width, there’s usually what looks like some kind of padding at the right end of the longest menu item(s). We set the menu item color depending on the item type, but I noticed that the space is even there if I leave the skin with the default transparent settings and just hover over it. I tried setting the width settings, and, if I make them large enough, I can get it to not show that space, but, the problem with that is, we need to add the items dynamically so we don’t know how wide the menu needs to be, and we don’t want a whole lot of extra space with nothing in it.

                We have the menu in a user control that we’ll add to each page. We currently have the RadMenu inside a RadSlidingPane inside a RadSlidingZone, and we add that user control to a RadPane within a RadSplitter in the pages they’re added to, but I tried doing it without the splitters, zones, and panes, and it still didn’t do it right.

I was wondering if the problem had to do with the items being adding from the code-behind page instead of from the ASPX page, but I found it did the same thing when I hard-coded them in.  I’ve attached a sample image of what the menu item widths look like. If you have any suggestions on what could be changed to get the items to look right, they would be greatly appreciated! Thank you so much!
                                Holly

Holly
Top achievements
Rank 1
 answered on 30 Mar 2012
2 answers
108 views
Hi,


This is Rathan,


I placed the two datepickker controls inside radgrid ,i want to calculate the days between two dates using javascript.

please help me how can i get the value of datepicker control value when i selected the date from picker  for caluclating days.

forexample :
var date=document.getelementbyid('datepicker1').value; (for normal javascript)

how can i get the value of datepicker like above example.

Eyup
Telerik team
 answered on 30 Mar 2012
1 answer
59 views
Hi guys, im hoping someone can help me out here. Getting a strange rendering issue with the datepicker control on the grid when trying to set a date filter. Basically the control seems to be positioned permanently over the grid when scrolling horizontally. I've attached a screenshot showing the problem.As you can see the datepicker for the date column 'Period To' seems to be completely detached from its usual position. If I scroll across the datepicker also scrolls, same applies to all other date columns - you can just about see the date of birth column has the same issue

Any suggestions?

PS I had to blank out some of the data in the grid as its sensitive data
Eyup
Telerik team
 answered on 30 Mar 2012
1 answer
120 views
Hi,
I'm trying to use http://www.telerik.com/community/code-library/aspnet-ajax/ajax/how-to-set-100-height-and-random-styles-to-a-radajaxmanager-update-panel.aspx
Is it possible to set css rule:
#<%= RadGrid1PanelClientID %>
{
    margin:0;
    height:100%;
}

 in this scenario from codebehind?
Thanks.
Maria Ilieva
Telerik team
 answered on 30 Mar 2012
2 answers
390 views
I was following an example I found on the site but for some, and it works up to teh point of finding the link buttons text.  I need the linkbuttons command argument  or the actual text of the link button becuase this is the parameter I need to send thru the querysting to open that page.

It does not seem to get either method.
Protected Sub myRadGridFin_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGridFin.ItemCreated
        If TypeOf e.Item Is GridDataItem Then
            Dim SendDDn As String
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
            Dim img As Image = DirectCast(item.FindControl("imgPrint"), Image)
            Dim DDN As LinkButton = DirectCast(item.FindControl("lnkAdd"), LinkButton)
  
            SendDDn = DDN.CommandArgument.ToString
            "neither works"
            SendDDn = DDN.Text.ToString
  
            img.Attributes.Add("onclick", "javascript:window.open('??.aspx?DDN=" + SendDDn.ToString() & "'); return false;")
        End If
  
    End Sub
Kevin
Top achievements
Rank 1
 answered on 30 Mar 2012
2 answers
143 views
So I have a print image as part of my radgrid.  What I want to do is hide the image button of there is nothing existing for the linkbutton becuase I hide duplicates of the link button.  So where the linkbutton is not there I want to also hide the printer image.

<telerik:RadGrid ID="myRadGridFin" runat="server" Width="100%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040" Skin="Web20">
                                   <MasterTableView AutoGenerateColumns="false" DataKeyNames="intRecId" Name="MasterGrid" BorderColor="#404040" Font-Size="9" Font-Names="Veranda,arial,sans-serif"
                                       HeaderStyle-HorizontalAlign="Center" GridLines="Both" BorderWidth="1px"><AlternatingItemStyle BackColor="#B0C4DE"  HorizontalAlign="Center" /><ItemStyle HorizontalAlign="Center" />
                                       <HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                                           <Columns>
                                               <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" ConfirmText="Are you sure you want to delete item from turn-in" />
                                               <telerik:GridTemplateColumn>
                                                   <ItemTemplate>
                                                       <asp:Image ID="imgPrint" runat="server" ImageUrl="~/Images/Printer.png" style="cursor:pointer" />
                                                   </ItemTemplate>
                                               </telerik:GridTemplateColumn>
                                               <telerik:GridTemplateColumn HeaderText="DDN">
                                                   <ItemTemplate>
                                                       <asp:LinkButton ID="lnkAdd" runat="server" Text='<%# bind("strDDN") %>' ToolTip="Click to Add Equipment to Doc Number" CommandName="Add" CommandArgument='<%#Bind ("strDDN") %>'></asp:LinkButton>
                                                   </ItemTemplate>
                                               </telerik:GridTemplateColumn>
                                               <telerik:GridTemplateColumn HeaderText="CATEGORY">
                                                   <ItemTemplate>
                                                       <asp:Label ID="lblCategory" runat="server" Text='<%# Bind("strCategory") %>'></asp:Label>
                                                       <asp:Label ID="lblCatId" runat="server" Text='<%#bind ("intCategoryId") %>' Visible="false"></asp:Label>
                                                   </ItemTemplate>
                                               </telerik:GridTemplateColumn>
                                               <telerik:GridBoundColumn DataField="strSN" HeaderText="SN" />
                                               <telerik:GridBoundColumn DataField="Equip" HeaderText="EQUIPMENT" />
                                               <telerik:GridBoundColumn DataField="Location" HeaderText="LOCATION" />
                                           </Columns>
                                   </MasterTableView>
                               </telerik:RadGrid>



Protected Sub myRadGridFin_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGridFin.ItemDataBound
       If (TypeOf e.Item Is GridDataItem) Then
           Dim img As Image = e.Item.FindControl("imgPrint")
           Dim lnk As LinkButton = e.Item.FindControl("lnkAdd")
           If lnk.Text = " " Then
               img.Enabled = False
               img.Visible = False
           End If
       End If
   End Sub


I also tried using it as an e.item.cell(?).text but this did not work either becuase it sees it as a linkbutton column I believe.
Kevin
Top achievements
Rank 1
 answered on 30 Mar 2012
3 answers
393 views
Hello,
I have a RadGrid inside a Webpart.  Its a non-visual webpart.
I am binding the grid to a Datasource of List<T>.
Every column is being returned from the datasource so I turned off AutoGenerateColumns to remove the extra columns and control what is painted on the screen.

Now the grid always displays "No records to display"...

The radgrid is created in the CreateChildControls override event:
radGridViewSearch = new RadGrid();
           radGridViewSearch.AutoGenerateColumns = false;
           radGridViewSearch.AllowPaging = true;
           radGridViewSearch.PageSize = 25;
           radGridViewSearch.NeedDataSource += new GridNeedDataSourceEventHandler(radGridViewSearch_NeedDataSource);
           this.Controls.Add(radGridViewSearch);


I am adding only one column to see if I can remove the possible reasons for the error:
GridBoundColumn colFacilityID = new GridBoundColumn();
           colFacilityID.DataField = "Facility";
           colFacilityID.HeaderText = "Facility";
           radGridViewSearch.Columns.Add(colFacilityID);


And the NeedDataSource event is used:
void radGridViewSearch_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {           
            lionRepository = new LionBCSRepository();
            radGridViewSearch.DataSource = lionRepository.BuildMatterDataSet(txtMatterNameSearch.Text.Trim(), txtContractNameSearch.Text.Trim(), txtPhysicianNameSearch.Text.Trim());
        }


I can see that 40+ records are returned, but its not binding them - is this some strange page life cycle issue?


Please help
Marin
Telerik team
 answered on 30 Mar 2012
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?