Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
328 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
348 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
263 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
15 answers
153 views
Hello,

My RadGrid was working fine when loading a datasource before I set AllowFilterByColumn="true" on it. Now I get a pop-up with a page error "Expected ')'". I try to debug the page but it doesn't break on the error, so I'm assuming it's being raised in one of the Telerik js files. Any idea what's going on here?

Thanks.
Princy
Top achievements
Rank 2
 answered on 02 Jul 2014
4 answers
332 views
I am trying to replace a textbox in a grid edit form with an autocomplete. The autocomplete is correctly suggesting the possible entries but does not bind the selected value to the db on insert.
So far this is the markup I am using where you see the old text box and the autocomplete.

<%-- <telerik:RadTextBox ID="ProjManag" TabIndex="2" runat="server" Width="200px" onkeypress="return this.value.length<=25" Text='<%# Bind( "ProjManag" ) %>'>
</telerik:RadTextBox>--%>
   
<telerik:RadAutoCompleteBox ID="ProjManag" runat="server" AllowCustomEntry="True" Culture="it-IT" DataSourceID="SqlDataSource1"  DataTextField="ProjManag" DataValueField="ProjManag" Filter="StartsWith" InputType="Text" Skin="Outlook">
</telerik:RadAutoCompleteBox>

How can I bind the selected value to the db? 
Shinu
Top achievements
Rank 2
 answered on 02 Jul 2014
9 answers
1.2K+ views
I am using a GrdTemplateColumn in order to display a CheckBox (Instead of a CheckBoxColumn) because I need the user to be able to check and uncheck the checkbox without first having to click EDIT.

The checkbox needs to be able to do an Asynchronus postback to the database (bit value).

I can get the checkbox to display, but I don't know how to get it to fire in the CodeBehind in order to update the appropriate row in the database.

                <telerik:GridTemplateColumn Reorderable="true" DataField="isSold" HeaderText="Sold" UniqueName="Sold">  
                    <HeaderStyle ForeColor="Blue" Font-Underline="true" /> 
                    <ItemTemplate> 
                        <asp:CheckBox AutoPostBack="true" OnCheckedChanged="CheckBox1_Changed" ID="CheckBox1" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "isSold") %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
Shinu
Top achievements
Rank 2
 answered on 02 Jul 2014
12 answers
387 views
Any chance to have that barcode type in the Q2 release ?

SR
lucysome
Top achievements
Rank 1
 answered on 02 Jul 2014
4 answers
148 views
I have created a RadDropDownTree inside a Popup WebUserControl for editing a row in the grid.
In the grid's UpdateCommand event, I grab a handle to the RadDropDownTree like this:

RadDropDownTree ddtMount = userControl.FindControl("ddtMount") as RadDropDownTree;

Even if the user check-marks some of the items in the tree, they all come back as "checked = false".

Anyone have an idea what I could be doing wrong? I can post more code details if needed.

TIA,

Jeffrey Taylor
Jeffrey
Top achievements
Rank 1
 answered on 01 Jul 2014
4 answers
127 views
Hi,

Would you have the SQL for the two tables used in the Datasource provider demo please?
Or even a sample?

Cheers,
jon
Jon
Top achievements
Rank 1
 answered on 01 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?