Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
271 views
I'm populating information from a webservice into a radcombobox in asp.net.  I would like to force a line break for certain items to clean up the dropdown information.

No matter what I put in the text field, it always just renders the text and never actually creates a line break.  I looked into creating an itemtemplate for the combobox, but from what I've read, it's not worth the effort when using a webservice.

Is there an escape character that I could use to force a line break?

Thanks,
Javier
Javier
Top achievements
Rank 1
 answered on 07 Jul 2011
2 answers
177 views

I have a RadGrid where I'm truncating the display of cell data in order to preserve page real estate.  I want to show the full cell content in a RadToolTip.

On the server, in the GridItemDataBound server-side event handler, I'm transforming the values of each cell for display.  On the client, I'm truncating the display data using text-overflow:ellipsis.  On the server, I'm creating a RadToolTip with the full value, and shoving it into the Page object's Controls collection:

var item = (GridDataItem)e.Item;
var cell = item["Flavor"];
cell.Text = reallyLongFlavorNameValue;

var tooltip = new RadToolTip();
tooltip.Title = "Flavor";
tooltip.Text = reallyLongFlavorNameValue;
tooltip.TargetControlID = cell.ID;
tooltip.IsClientID = false;
tooltip.RelativeTo = ToolTipRelativeDisplay.Element;
this.Controls.Add(tooltip);

I'm assuming the rest of the values can be defaults.

However, when I show the page, the tooltip never shows. 

What am I missing?


Thanks
KN425000
Top achievements
Rank 1
 answered on 07 Jul 2011
2 answers
102 views
Hi. A few questions about the Sharepoint Acceleration Kit:
  • In the regular editor available in Sharepoint 2010, when we choose to insert an image in a page, there's no easy way to choose an image from the "Site Assets"; we have to upload the image every time from our computer or copy/paste the image URL. Does the SAK tool provide an easy way to choose an image from the Site Assets (or other library)?
  • I've read that the CTP will move to a final release later this year. Is that true?
Thank you :)
Alex
Top achievements
Rank 1
 answered on 07 Jul 2011
3 answers
75 views
Hi,

I'm having some small problems with RadGrid.

Issue 1:
Here is an example page
http://dev2.spireweb.no/resultat.aspx?pid=15&rb=1&type=simpel&q=test
When I fill in a value in the textbox the first time and then I click "Kjøp" then it does not find the value of the textbox, and just add 1 item to cart (handlevogn), but the second time I click "kjøp" it finds the value enter in the textbox.
Here is my ItemCommand code:
protected void radResult_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
    switch (e.CommandName)
    {
        case "AddToCart":
            int test = e.Item.DataSetIndex;
            TextBox txtQuantity = (TextBox)(e.Item.FindControl("txtQuantity"));
            if (txtQuantity.Text.Length > 0)
                ShoppingCart.GetCurrentUsersCart.AddItem(int.Parse(e.CommandArgument.ToString()), int.Parse(txtQuantity.Text.ToString()));
            else
                ShoppingCart.GetCurrentUsersCart.AddItem(int.Parse(e.CommandArgument.ToString()), 1);
            txtQuantity.Text = "";
             
            RadAjaxManager1.ResponseScripts.Add("javascript:updateCart();");
            //RadAjaxManager1.ResponseScripts.Add(string.Format("alert('Hello from the server! Server time is {0}');", DateTime.Now.ToLongTimeString()));
            break;
    }
}

Why do this happen?

Issue 2:
Who can I "reset" the sort, so it goes back to first sort state?
Here is an example page:
http://dev2.spireweb.no/resultat.aspx?pid=15&rb=2&type=simpel&q=test
If I click "Vis treff A-Å" how can I go back to the sort state the radgrid started with?

Thanks in advaned...
Marin
Telerik team
 answered on 07 Jul 2011
4 answers
484 views
Hi All

I am calling the insert form of radgrid using the fireCommand from javascript that is triggered by and external button,
However seeing as i am using a custom command name it will not trigger unless the grid has some data,
I tried changing the command name to InitInsert....however this does not trigger the grids Item_command server side for some reason!

I need to trigger the Item_command as i need to control the event.

Could someone tell me why this is not triggering using InitInsert and it triggered using my custom command?

Many Thanks

Regards

Cush
Cush
Top achievements
Rank 1
 answered on 07 Jul 2011
8 answers
168 views
Hi,
I'm using the "Client edit with batch server update" example to make my own grid. I have a question that I haven't found the solution. How can I insert a new row using gridTemplatecolumns? I have add a command Item Template linkButton element for the inserting, but when I click on it, it is only appearing for inserting a column that is a bound one. How can I do for Inserting items using template columns?
I'm trying to work in server-side all I can.
Thanks,
Jon
Ja
Top achievements
Rank 1
 answered on 07 Jul 2011
1 answer
97 views
Hi Telerik
I have a colour scheme for my line chart - however this colour scheme does not translate very well when printed in black and white. One option is to set one of my lines to use a penstyle other than solid and this works quite well. However the legend doesn't reflect this and having printed the chart in b&w, the user is no wiser as to which chart series is which - they can see one is dotted (or dashdot etc), they just can't tell which one from the legend.

Is there a way to style the legend to reflect this?  By default the legend items are shown as squares, so this would need to change to a line or something in order for the penstyle to be visible.

thanks
--Mike
Evgenia
Telerik team
 answered on 07 Jul 2011
1 answer
98 views
Hello,

I was using a tooltip for radgrid. On mouse over on radgrid row tooltip pops up.

After loading the dynamic data in tooltip, it changes its position and moves up. Becase of this this tooltip points to some other row in radgrid which is misleading.

note:- its ovserved posiotion change of tooltip happens when tooltip is at end of the web page below.

I would like the tooltip should not move or though it move it should point to the exact row of radgrid.

Can you please suggest me the best way to achieve this ?

tooltip code:
<telerik:RadToolTipManager ID="ttm_CSMD_Backlog_By_Status_FL" runat="server" EnableShadow="true" 
    Animation="Fade"   OnAjaxUpdate="OnAjaxUpdate" HideEvent="ManualClose"  AnimationDuration="2000"
    Position="BottomRight"  RelativeTo="Element" OffsetY="0" OnClientResponseEnd="OnClientResponseEnd">
</telerik:RadToolTipManager>

please see attached images for more clarity.
Marin Bratanov
Telerik team
 answered on 07 Jul 2011
1 answer
70 views
Hi,

I have a list of items and have placed 2 DataPagers on the page.

One sits above the list and one below.

If I click on one, everything works as it should and I get the next page of results.

Unfortunately though, the DataPagers then get out of sync (ie. One will have the new page number set but the other one still displays the old page index)

Is there anyway I can keep them in sync?

Thanks
Daniel
Telerik team
 answered on 07 Jul 2011
2 answers
137 views
Hi,

I'm trying to use a grid to display Facilities and Contacts. A 'Facility' would be something like a factory, office or location and there is a parent/child relationship between the two.

In my DetailTable, I would like the user to be able to add a new contact. When the 'Add new record' link is clicked, I would like to fill a combobox with contacts that are NOT currently assigned to the Facility.

I'm using the following thread as a guide.

http://www.telerik.com/community/forums/aspnet-ajax/grid/fill-datasource-in-radcombobox-within-edititemtemplate-of-radgrid.aspx

I'm trying to use the ItemDataBound event to fill my combobox. The problem that I have is that I'm unable to find a reference to the FacilityID in this method. I've tried using insertItem.ParentItem but this is null when I try and read it in debug mode.

Can someone point me in the right direction?

Thanks,
Tim

Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
 
    If (TypeOf e.Item Is GridEditFormInsertItem) AndAlso (e.Item.OwnerTableView.IsItemInserted) Then
        Dim insertItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
        Dim combo As DropDownList = DirectCast(insertItem("colContactId").FindControl("cboContactID"), DropDownList)
 
        Dim conn As New SqlConnection(connectionstring)
        conn.Open()
        'How do I reference FacilityID from the line below????
        Dim adp As New SqlDataAdapter("SELECT ContactName,ContactID from  Contacts WHERE ContactID NOT IN (Select ContactID From FacilityContacts WHERE FacilityID=<NeedHelpHere>", conn)
        Dim dt As New DataTable()
        adp.Fill(dt)
        combo.DataSource = dt
        combo.DataTextField = "ContactName"
        combo.DataValueField = "ContactID"
        combo.DataBind()
        conn.Close()
    End If
 
End Sub



<telerik:RadGrid ID="RadGrid1" ShowStatusBar="True" DataSourceID="dsFacilityList"
    runat="server" PageSize="7" AllowSorting="True" AllowPaging="True" GridLines="None"
    CellSpacing="0" AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True" >
    <PagerStyle Mode="NumericPages"></PagerStyle>
    <MasterTableView DataSourceID="dsFacilityList" AllowMultiColumnSorting="True"
        PageSize="20" CommandItemDisplay="Top" DataKeyNames="FacilityID" EditMode="EditForms" >
        <EditItemTemplate>
 
        </EditItemTemplate>
        <DetailTables>
            <telerik:GridTableView runat="server" DataKeyNames="FacilityID"
                DataSourceID="dsFacilityContactList2" CommandItemDisplay="Top"
                AutoGenerateColumns="False">
                 
                 
                <EditItemTemplate>
               
                </EditItemTemplate>
                 
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="FacilityID"
                        MasterKeyField="FacilityID" />
                </ParentTableRelation>
                <CommandItemSettings ExportToPdfText="Export to PDF" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn DataField="ContactID"
                        FilterControlAltText="Filter column column" UniqueName="colContactId" >
                        <EditItemTemplate>
                               Contact ID <asp:TextBox ID="ContactIDTextBox" runat="server"
                                Text='<%# Bind("ContactID") %>'></asp:TextBox>
 
                                    <asp:DropDownList ID="cboContactID" runat="server">
                                   </asp:DropDownList>
 
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="ContactIDLabel" runat="server" Text='<%# Eval("ContactID") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="FacilityID"
                        FilterControlAltText="Filter column1 column" UniqueName="column1">
                        <EditItemTemplate>
 
 
                            Facility ID <asp:TextBox ID="FacilityIDTextBox" runat="server"
                                Text='<%# Bind("FacilityID") %>'></asp:TextBox>
 
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="FacilityIDLabel" runat="server" Text='<%# Eval("FacilityID") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </telerik:GridTableView>
        </DetailTables>
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
            Visible="True">
        </ExpandCollapseColumn>
        <SortExpressions>
 
        </SortExpressions>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
     
    </MasterTableView>
 
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>




Tim
Top achievements
Rank 1
 answered on 07 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?