<style type="text/css"> |
html, body, form |
{ |
width: 100%; |
height: 100%; |
overflow: hidden; |
} |
</style> |
If i use a simple radgrid with Scrolling-UseStaticHeaders="true" on a page, without any container or other control, the grid is 100% heigth, and this is working perfect.
But as soon as i put a RadAjaxmanager on the page, the RadGrid is going from 300px to 10 px in a split second when the page load, and stays 10px.
e.q.
<telerik:RadAjaxManager ID="RAM" runat="server" > |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="myRadrid (or any other control)"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="myRadGrid" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
For testing i put the Radgrid inside the form container, so the heigth for the container is set.
I can write a workaround in js to follow the window height, but that is not real smooth solution.
The Grid is then loading from 300px, to 10px, and then the right height...
I'am sure the RadAjaxmanager is the reason for this, but is there a solution?
p.s. i use the latest 2009.1 402 build.
<asp:SqlDataSource ID=
"SqlDataSource1"
ConnectionString=
"<%$ ConnectionStrings:IPdataConnectionString %>"
ProviderName=
"System.Data.SqlClient"
SelectCommand=
"SELECT top 7 Date = CONVERT(char(10), Date, 101), score, IPaddress, Partner FROM IPhistory WHERE Partner = 'NEAstates' ORDER BY Date ASC;"
runat=
"server"
>
</asp:SqlDataSource>
<telerik:radchart id=
"RadChart4"
runat=
"server"
width=
"800px"
datasourceid=
"SqlDataSource1"
defaulttype=
"Line"
autolayout=
"true"
charttitle-visible=
"false"
>
<Appearance TextQuality=
"AntiAlias"
>
</Appearance>
<PlotArea>
<Appearance Dimensions-Margins=
"18%, 24%, 12%, 16%"
></Appearance>
<YAxis Step=
"10"
AxisMode=
"Extended"
>
<Appearance MajorGridLines-Visible=
"true"
MinorGridLines-Visible=
"false"
>
</Appearance>
</YAxis>
<XAxis DataLabelsColumn=
"Date"
LayoutMode=
"Between"
>
<Appearance ValueFormat=
"ShortDate"
MajorGridLines-Visible=
"true"
>
<LabelAppearance RotationAngle=
"10"
Position-AlignedPosition=
"Top"
>
</LabelAppearance>
</Appearance>
</XAxis>
</PlotArea>
</telerik:radchart>
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!Page.IsPostBack)
{
// Manually setting the series groups and Y values columns
RadChart4.DataGroupColumn =
"IPaddress"
;
RadChart4.DataManager.ValuesYColumns =
new
string
[1] {
"score"
};
RadChart4.Skin =
"LightBlue"
;
ChartSeries chartSeries =
new
ChartSeries();
chartSeries.Type = ChartSeriesType.Line;
chartSeries.Appearance.LabelAppearance.Visible =
false
;
}
}
I am populating RadPanelBar from the database. The following is my code. I have a db column that specifies enable true or false. I would like to set the RadPanelItem enable property using this. How can I do this?
Dim dt As New DataTable
dt =GetPanelItems(Id) – proc to call oracle
Dim links As New DataSet()
links.Tables.Add(dt)
RadPanelBar1.DataTextField = "panel_name"
RadPanelBar1.DataNavigateUrlField = ""
RadPanelBar1.DataFieldID = "panel_id"
RadPanelBar1.DataFieldParentID = "Parent_panel_Id"
RadPanelBar1.DataValueField = "panel_value"
RadPanelBar1.DataSource = links
RadPanelBar1.DataBind()
Thanks
<%@ Page Language="C#" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
script
runat
=
"server"
>
protected void DownloadForShot_ImageButton_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
ImageButton btnDownload = (ImageButton)sender;
GridDataItem dataItem = (GridDataItem)btnDownload.NamingContainer;
RadGrid Attachments_RadGrid = (RadGrid)dataItem.NamingContainer.NamingContainer;
Label lblShotID =(Label)Attachments_RadGrid.NamingContainer.FindControl("ShotID_Label");
try
{
//NOTE THE HARD CODED VALUE HERE
System.IO.FileInfo file = new System.IO.FileInfo("C:\\inetpub\\wwwroot\\TestSite\\Images\\TestPDF.pdf");
if (file.Exists)
{
Response.ClearContent();
Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", file.Name));
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/pdf"; // "image/jpeg"
Response.TransmitFile(file.FullName);
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
else
{
throw new Exception("There is no attachment for this path or the path is not valid.");
}
}
catch (Exception ex)
{
Response.Write("<
span
style
=
'color:red;'
>" + ex.Message + "</
span
>");
}
}
protected void ShotDetail_RadGrid_PreRender(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (ShotDetail_RadGrid.MasterTableView.Items.Count > 0)
{
ShotDetail_RadGrid.MasterTableView.Items[0].Expanded = true;
ShotDetail_RadGrid.MasterTableView.Items[0].ChildItem.FindControl("InnerContainer").Visible = true;
}
}
}
</
script
>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
>Title</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
div
id
=
"div_Shots_ShotDetail"
style
=
"width:99%; height:1500px; position:absolute;"
>
<
telerik:RadGrid
ID
=
"ShotDetail_RadGrid"
runat
=
"server"
DataSourceID
=
"XmlDataSource1"
AllowPaging
=
"True"
Skin
=
"Hay"
GridLines
=
"None"
ShowStatusBar
=
"True"
Width
=
"921px"
onprerender
=
"ShotDetail_RadGrid_PreRender"
>
<
HierarchySettings
ExpandTooltip
=
"Show related merch"
CollapseTooltip
=
"Collapse merch"
></
HierarchySettings
>
<
ExportSettings
IgnorePaging
=
"True"
>
<
Pdf
PageBottomMargin
=
"0.5in"
PageHeight
=
"8.5in"
PageLeftMargin
=
"0.35in"
PageRightMargin
=
"0.35in"
PageTopMargin
=
"0.5in"
PageWidth
=
"11in"
/>
</
ExportSettings
>
<
ClientSettings
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
DataSourceID
=
"XmlDataSource1"
AutoGenerateColumns
=
"False"
AllowCustomPaging
=
"True"
>
<
NestedViewTemplate
>
<
asp:Panel
runat
=
"server"
ID
=
"InnerContainer"
CssClass
=
"viewWrap"
Visible
=
"false"
>
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"TabStip1"
MultiPageID
=
"Multipage1"
SelectedIndex
=
"0"
Width
=
"884px"
>
<
Tabs
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Attachments"
PageViewID
=
"PageView2"
Selected
=
"True"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
runat
=
"server"
ID
=
"Multipage1"
SelectedIndex
=
"0"
RenderSelectedPageOnly
=
"false"
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"PageView1"
>
<
asp:Label
ID
=
"ShotID_Label"
runat
=
"server"
Text='<%# Eval("ShotID") %>' Visible="false" />
<
asp:Label
ID
=
"Error_Label"
runat
=
"server"
></
asp:Label
>
<
telerik:RadGrid
ID
=
"Attachments_RadGrid"
runat
=
"server"
DataSourceID
=
"XmlDataSource2"
GridLines
=
"None"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"XmlDataSource2"
>
<
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
UniqueName
=
"ColumnDownload"
>
<
ItemTemplate
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
>
<
asp:ImageButton
ID
=
"DownloadForShot_ImageButton"
runat
=
"server"
ImageUrl
=
"~/Images/view.gif"
OnClick
=
"DownloadForShot_ImageButton_Click"
/>
</
telerik:RadAjaxPanel
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"AttachmentTitle"
HeaderText
=
"Attachments"
UniqueName
=
"ColumnAttachment"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
<
asp:XmlDataSource
ID
=
"XmlDataSource2"
runat
=
"server"
DataFile
=
"~/XMLFile2.xml"
></
asp:XmlDataSource
>
</
telerik:RadPageView
>
<
telerik:RadPageView
Runat
=
"server"
Width
=
"100%"
ID
=
"PageView2"
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
asp:Panel
>
</
NestedViewTemplate
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
></
CommandItemSettings
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
></
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
></
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ShotID"
HeaderText
=
"ShotID"
UniqueName
=
"ShotID"
FilterControlAltText
=
"Filter ShotID column"
SortExpression
=
"ShotID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"JobNumber"
HeaderText
=
"JobNumber"
UniqueName
=
"JobNumber"
FilterControlAltText
=
"Filter JobNumber column"
SortExpression
=
"JobNumber"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
<
PagerStyle
AlwaysVisible
=
"True"
/>
</
MasterTableView
>
<
PagerStyle
AlwaysVisible
=
"True"
/>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
<
HeaderContextMenu
EnableImageSprites
=
"True"
CssClass
=
"GridContextMenu GridContextMenu_Default"
></
HeaderContextMenu
>
</
telerik:RadGrid
>
<
asp:XmlDataSource
ID
=
"XmlDataSource1"
runat
=
"server"
DataFile
=
"~/XMLFile.xml"
></
asp:XmlDataSource
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
</
div
>
</
div
>
</
form
>
</
body
>
</
html
>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
tables
>
<
tShots
ShotID
=
"15736"
JobNumber
=
"254960"
/>
<
tShots
ShotID
=
"15737"
JobNumber
=
"254960"
/>
<
tShots
ShotID
=
"15738"
JobNumber
=
"254960"
/>
<
tShots
ShotID
=
"15739"
JobNumber
=
"254960"
/>
<
tShots
ShotID
=
"15740"
JobNumber
=
"254960"
/>
<
tShots
ShotID
=
"15741"
JobNumber
=
"254960"
/>
</
tables
>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
tables
>
<
tAttachments
ShotID
=
"14394"
AttachmentExtension
=
".jpg"
AttachmentPath
=
"~/images/Image1/file1.jpg"
AttachmentTitle
=
"File Name 1"
/>
<
tAttachments
ShotID
=
"15737"
AttachmentExtension
=
".jpg"
AttachmentPath
=
"~/images/Image1/file2.jpg"
AttachmentTitle
=
"File Name 2"
/>
<
tAttachments
ShotID
=
"15738"
AttachmentExtension
=
".jpg"
AttachmentPath
=
"~/images/Image1/file3.jpg"
AttachmentTitle
=
"File Name 3"
/>
<
tAttachments
ShotID
=
"15739"
AttachmentExtension
=
".jpg"
AttachmentPath
=
"~/images/Image1/file4.jpg"
AttachmentTitle
=
"File Name 4"
/>
<
tAttachments
ShotID
=
"15740"
AttachmentExtension
=
".jpg"
AttachmentPath
=
"~/images/Image1/file5.jpg"
AttachmentTitle
=
"File Name 5"
/>
</
tables
>
<
system.webServer
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
/>
</
modules
>
<
handlers
>
<
remove
name
=
"asset"
/>
<
add
name
=
"asset"
preCondition
=
"integratedMode"
verb
=
"GET,HEAD"
path
=
"asset.axd"
type
=
"Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc"
/>
<
add
name
=
"Ajax"
verb
=
"POST,GET"
path
=
"ajax/*.ashx"
type
=
"Ajax.PageHandlerFactory, Ajax"
/>
</
handlers
>
</
system.webServer
>
<
httpModules
>
<!-- Add this line exactly as is - the name value is important -->
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
/>
</
httpModules
>