Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
96 views
I'm having a bit of trouble with the SetupInputManager scenario, as described in your documentation:  
http://www.telerik.com/help/aspnet-ajax/grid-linq-to-sql-manual-crud-operations.html.

I've used this quite a number of times but this is a little different.

I have a grid with a conventional header/detail setup.  

What I would like to do, when a detail record goes into Edit mode, is to customize the label of a specific editing textbox within the detail record, based on the header's ID.

Is this possible?
Princy
Top achievements
Rank 2
 answered on 02 Jul 2014
3 answers
482 views

Hello,

I am trying to implement a RadComboBox with a datasource that can have up to 2,000 items. Therefore it is import that all the items do not get loaded at once. However I also want a RadComboBox with checkboxes, and I want to be able to select multiple values. The issue I am running into is when I have EnableLoadOnDemand="true" the checkboxes that were checked when searching for one word do not persist.

As an example: If I search for "Apple" check that off and then search for "Zinc" check that off and search for "Apple" again, the checkbox for "Apple" will not appear checked off. This happens even if open the drop down and check of the first 5 items then search for something that's not being displayed in the dropdown, or something that is being displayed, it doesn't change the behavior, check that off and then go back to the original 5 items and they appear unchecked.

The issue doesn't appear to happen if EnableLoadOnDemand="false" however then the ComboBox control will try and load all 2,000 items and the page will start slowing down.

I want to know if there is a way to get this behavior either with EnableLoadOnDemand="true" or if its possible to limit how many items are displayed when EnableLoadOnDemand = "false". Also note that the OnItemsRequested event does not get raised when EnableLoadOnDemand is set to False.


Markup:

<telerik:RadComboBox ID="RadComboBox2" runat="server" Visible="true"  MaxHeight="330" Width=" 200px"
                                Label="Look up values:" filter="Contains" AutoPostBack="false" EnableLoadOnDemand="true" EmptyMessage="Search Code..."
                                OnItemsRequested="RadComboBoxLargeLookup_ItemsRequested" ShowMoreResultsBox="true" ItemsPerRequest="50" EnableViewState="true">
                            <ItemTemplate>
                                <table>
                                    <tr>
                                        <td><input type="checkbox" /></td>
                                        <td><asp:Label runat="server" id="asdfasdf" Text='<%# DataBinder.Eval(Container, "Text")%>' /></td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </telerik:RadComboBox>

Code Behind:

protected void RadComboBoxLargeLookup_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            try
            {
                DataTable data = (DataTable)(this.ViewState["LookupValues"]);
 
                int itemOffset = e.NumberOfItems;
                int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
 
                e.EndOfItems = endOffset == data.Rows.Count;
 
 
                for (int i = itemOffset; i < endOffset; i++)
                {
 
                    RadComboBoxItem item = new RadComboBoxItem();
 
                    string name = data.Rows[i]["SortField"].ToString();
                    string code = data.Rows[i]["Code"].ToString();
 
                    item.Text = name;
                    item.Value = code;
 
                     
                    RadComboBox radComboBox = sender as RadComboBox;
 
                    radComboBox.Items.Add(item);
 
                    item.DataBind();
                }
            }
            catch (Exception ex)
            {
 
            }
        }

Final goal is to allow the user to select multiple options and retain the ones that were selected that are not being displayed in the dropdown.

I also set EnabledViewState="true" per a recommendation on another support item, but that did not do anything.

Any advice is appreciated.

-Klaus

Nencho
Telerik team
 answered on 02 Jul 2014
9 answers
164 views
Hi,

If I use the listviewdesigner and choose a view from a list where the ID is not selected in the view, listviewdesigner creates a table with the ID vissible in it.
I don't want to see the ID.
How do I change this behaviour?

Regards,
Edwin
Marin
Telerik team
 answered on 02 Jul 2014
5 answers
480 views
Hello. I recently incorporated AJAX RadChart into our project, and I'm working on polishing it now.

We have a logarithmic YAxis, and it doesn't seem to be scaling properly. I have AutoScale=True and IsZeroBased=false.

The chart displays a huge empty portion of the chart, between 1 and 10,000 on the Axis. There isn't even any data value below 10,000. Why is it plotting this empty area? It should start plotting near the bottom of the data lines, right?

Here is my chart:

<telerik:RadChart ID="PmChart" runat="server" EnableViewState="True" DefaultType="Line" Skin="Outlook" OnZoom="PmChart_Zoom">
    <ClientSettings ScrollMode="Both" />
    <ChartTitle Visible="False" />
    <PlotArea>
        <XAxis LayoutMode="Inside" AutoScale="False" IsZeroBased="False" DataLabelsColumn="ChartDate">
            <Appearance MajorGridLines-Visible="false">
                <LabelAppearance RotationAngle="270" Position-AlignedPosition="Top" />
            </Appearance>
        </XAxis>
        <YAxis AutoScale="True" IsZeroBased="False" />
        <YAxis2 AutoScale="True" IsZeroBased="False" />
    </PlotArea>
</telerik:RadChart>


I've attached an image to help illustrate my problem. Any help would be greatly appreciated. Thanks!
Danail Vasilev
Telerik team
 answered on 02 Jul 2014
4 answers
170 views
Is there a way to transfer all items from source listbox to destination listbox on a client side using javascript?

Thanks!
Nencho
Telerik team
 answered on 02 Jul 2014
1 answer
280 views
Hi,

I have a RadSearchBox in my form as shown in the attachment. Initially when the RadSearchBox is empty I want to hide the cross image button. When the user enter some search text and click the Search button (lens image) the RadSearchBox1_Search event will fire where I am filtering a radgrid and that time I want to hide the Search button and show the cross image button.
On Clicking the Cross image button the RadSearchBox1_ButtonCommand event will fire where I am clearing the grid filter and then I want to hide the cross image button and show the Search Button.

Is it possible to selectively hide and show the buttons inside RadSearchBox?

Thanks,
Vishnu.
Nencho
Telerik team
 answered on 02 Jul 2014
1 answer
314 views
I have the below Tile with databanding. When first time the page loads tile click works fine. But when the postback event triggers due to radio button selection change and the tiles load, first click to any tile does nothing. Again 2nd click it's works fine. Here is the code. Not sure what missing? Thanks for helping in a advance.

aspx:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>
​<telerik:RadTileList ID="RadTileList1" runat="server" AppendDataBoundItems="false" Font-Bold="true" Font-Size="X-Large" Width="100%" TileRows="4" OnTileDataBound="RadTileList1_OnTileDataBound" OnTileCreated="RadTileList1_OnTileCreated" SelectionMode="Single" EnableDragAndDrop="false"
OnTileClick="RadTileList1_TileClick" AutoPostBack="true" ScrollingMode="None" >

    <DataBindings>

       <CommonTileBinding TileType="RadImageAndTextTile" Shape="Wide" DataNameField="MEMBER_CAPTION"/>
       <ImageAndTextTileBinding DataTextField="MEMBER_CAPTION" />
       <TilePeekTemplate>
          <div id="dvTile" runat="server" style="font-size:small;" >
             <h3 style="text-align:center;font-family:'Times New Roman';"><%#DataBinder.Eval(Container.DataItem, "MEMBER_CAPTION")%></h3>
             <strong>Clicks:</strong>
             <%#DataBinder.Eval(Container.DataItem, "Clicks")%>                                                                                                                                  
           </div>
        </TilePeekTemplate>         
    </DataBindings>
</telerik:RadTileList>
<asp:RadioButtonList id="rdSort" runat="server" AutoPostBack="true" CellPadding="10" CellSpacing="20" RepeatDirection="Horizontal"
OnSelectedIndexChanged="rdSort_SelectedIndexChanged">
<asp:ListItem Text="Clicks" Value="Clicks" selected="true" />
<asp:ListItem Text="Impressions" Value="Impressions" />
<asp:ListItem Text="CTR" Value="Click Thru Rate" />
</asp:RadioButtonList>

</ContentTemplate>
</asp:UpdatePanel>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
                
                BindMainContaint();
    }
}
private void BindMainContaint()
{
RadTileList1.DataSource = dataTableForTile;
RadTileList1.TileRows = 4;
RadTileList1.DataBind();

}
protected void RadTileList1_OnTileDataBound(object sender, TileListEventArgs e)
{
//test the tile type first so its specific properties can be used
RadImageAndTextTile tile = e.Tile as RadImageAndTextTile;
//ImageAndTextTileBinding t = e.Tile as ImageAndTextTileBinding;
if (!object.Equals(tile, null))
{
e.Tile.PeekContentContainer.BackImageUrl = ((System.Data.DataRowView)(e.Tile.DataItem)).Row["Colorbar"].ToString();
tile.ImageUrl = ((System.Data.DataRowView)(e.Tile.DataItem)).Row["Colorbar"].ToString();// DataBinder.GetPropertyValue(e.Tile.DataItem, "Colorbar", null);
e.Tile.PeekContentContainer.Visible = true;
}
}
protected void RadTileList1_OnTileCreated(object sender, TileListEventArgs e)
{
//work with common settings for all tiles
e.Tile.PeekTemplateSettings.ShowInterval = 10;
//e.Tile.PeekTemplate.InstantiateIn = true;
e.Tile.PeekTemplateSettings.CloseDelay = 0;
e.Tile.PeekTemplateSettings.ShowPeekTemplateOnMouseOver = true;
e.Tile.PeekTemplateSettings.HidePeekTemplateOnMouseOut = false;
e.Tile.PeekTemplateSettings.AnimationDuration = 10;
//using properties specific for a given tile type - check the tile type first
RadImageAndTextTile tile = e.Tile as RadImageAndTextTile;
//e.Tile.PeekContentContainer.BackColor = System.Drawing.Color.Violet;
if (!object.Equals(tile, null))
{
tile.ImageWidth = System.Web.UI.WebControls.Unit.Percentage(100);
// tile.BackColor = System.Drawing.Color.Violet;
tile.ImageUrl = "~/Images/green-bar.png";
tile.Shape = TileShape.Wide;
}

}

protected void RadTileList1_TileClick(object sender, TileListEventArgs e)
{
            
            Response.Redirect("~/DrillDownPage.aspx");
}

protected void rdSort_SelectedIndexChanged(object sender, EventArgs e)
{
            
            BindMainContaint();
}


Marin Bratanov
Telerik team
 answered on 02 Jul 2014
3 answers
331 views
Hi All,

I have a radgrid, I set the  <MasterTableView Font-Names="Gill Sans MT"  >. I also set the style as

<style type="text/css">
    .rgMasterTable
    {
        font-family: Gill Sans MT !important;
    }
</style>

in web browser my Grid is showing the correct font (Gill Sans MT) and export to excel also showing correct font. But when I export it to pdf, it is not exporting in the Gill Sans MT font.  I also tried to set the

 <ExportSettings>
                    <Pdf DefaultFontFamily="Gill Sans MT" />
                </ExportSettings>

But still no luck. then I tried from code-behind as

 protected void btnpdfCard_Click(object sender, ImageClickEventArgs e)
    {
             
        foreach (GridDataItem item in rgExportGrid.Items)
        {
            item.Style["font-family"] = "Gill Sans MT";
            item.Style["font-size"] = "6px";
        }
rgExportGrid.MasterTableView.ExportToPdf();
}

but still no luck to export with Gill Sans MT font. Can anyone let me know where I am wrong?

Thanks in advance.

Princy
Top achievements
Rank 2
 answered on 02 Jul 2014
4 answers
1.9K+ views
Hello,

I am do have data extending the column width. But I want to row without data wrap and truncated row should displayed with "..." extension. I do have a dataset as a datasource for the grid. Is it possible with some string format to achieve this ? Or can you suggest some better method to do this ?
Princy
Top achievements
Rank 2
 answered on 02 Jul 2014
1 answer
246 views
In a grid am having an image button ; on click o to open a file that is there in database.

My code is like this

protected void imgBtnPersonalView_Click(object sender, ImageClickEventArgs e)
{
        
            ImageButton imgBtnPersonalView = (ImageButton)sender;
GridDataItem dataItem = (GridDataItem)imgBtnPersonalView.NamingContainer;

string documentId = dataItem["Document_Id"].Text;
DataTable dt = objNewJoineeFormBL.GetDocumentUploadByDocumentId(documentId);
byte[] objData = (byte[]) dt.Rows[0]["Data"];
string strFileName = dt.Rows[0]["Document_Name"].ToString();
string fileExtension = dt.Rows[0]["File_Format"].ToString();

Response.Clear();
Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = fileExtension;
Response.AppendHeader("Content-Disposition", "attachment; filename=" + strFileName);
Response.BinaryWrite(objData);
Response.Flush();
Response.End();
}

I can see the data while debugging..
But when it comes to the last line, it shows an error like
0xc00ce514 - JavaScript runtime error: Could not complete the operation due to error c00ce514
i am attaching screen shot of it.
What i need is, a file window to open/ save button.
i got files in picture format, doc and pdf.


Thanks in advance


Angel Petrov
Telerik team
 answered on 02 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?