Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
78 views
I have a small bit of validation that when fails cancels an update. When this happens, the fields that i want to stay in edit mode do so but one column that is explicity set to readonly becomes editable also. Is there any reason for this?
Tsvetina
Telerik team
 answered on 16 Nov 2011
5 answers
287 views
Hello,

I have below RadScheduler control on my page. Code as below:

<asp:Content ID="Content1" ContentPlaceHolderID="main" runat="Server">
    <telerik:RadScheduler runat="server" ID="schedular" DataKeyField="ID" DataSubjectField="Subject"
        DataStartField="Start" DataEndField="End" StartEditingInAdvancedForm="true" DataRecurrenceField="RecurrenceRule"
        DataRecurrenceParentKeyField="RecurrenceParentID" OnAppointmentInsert="schedular_AppointmentInsert"
        OnAppointmentDelete="schedular_AppointmentDelete" StartInsertingInAdvancedForm="true">
    </telerik:RadScheduler>
</asp:Content>

I can insert the appointment easily but when I delete the appointment the Delete event (OnAppointmentDelete = "schedular_AppointmentDelete") gets Fired twice.

If I remove the recurrence properties (i.e.DataRecurrenceField, DataRecurrenceParentKeyField) then it works fine but I need Recurrence functionality.

Please let me know the solution to this problem.

Thanks,
Mayur.
Ivana
Telerik team
 answered on 16 Nov 2011
0 answers
590 views
Hi,
I have used a dynamically generated RadGrid for my application.
I would like to use the following functions:
1) Freeze header
2) Freeze columns
3) Resize one of the column
I know there's an article saying that resizing the column does not work with freezing header, so if we are to only use the freeze header and columns there are still some issues

here's the issues and settings I used:
- Freeze header only, no freezing columns
The grid has some alignment issue when scroll to the end, the header and content line is not aligned.
Pls see freezeheaderalignment.jpg
- Freeze header and column (must use layout = auto to make it show)
The last column disappear when using both freeze header and column and somehow the header height become very big and is it because of my fixed height, now i have 3 vertical scroll bars :(
Pls see freezeheaderncolumn.jpg

Also I noticed that I have to specify the width of each column otherwise the column will shrink, is there any auto-size property to automatically resize the column width as per content?

Here's my code:
RadGrid1 = new RadGrid();
RadGrid1.ID = "RadGrid1";
RadGrid1.Height = Unit.Pixel(535);
 
int intDefaultPercentage = 99;
bool isFixed = false;
if (!ConfigHelper.OPDashboardLayout.Equals(""))
{
    if (ConfigHelper.OPDashboardLayout.ToUpper().Equals("Fixed"))
        isFixed = true;
    RadGrid1.MasterTableView.TableLayout = (GridTableLayout)Enum.Parse(typeof(GridTableLayout), ConfigHelper.OPDashboardLayout);
}
 
RadGrid1.AutoGenerateColumns = false;
RadGrid1.ClientSettings.Scrolling.AllowScroll = true;
RadGrid1.ItemDataBound += new GridItemEventHandler(RadGrid1_ItemDataBound);
RadGrid1.PreRender += new EventHandler(RadGrid1_PreRender);
RadGrid1.ColumnCreated += new GridColumnCreatedEventHandler(RadGrid1_ColumnCreated);
RadGrid1.DetailTableDataBind += new GridDetailTableDataBindEventHandler(RadGrid1_DetailTableDataBind);
RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
RadGrid1.ExcelExportCellFormatting += new OnExcelExportCellFormattingEventHandler(RadGrid1_ExcelExportCellFormatting);
 
RadGrid1.MasterTableView.Name = "Master";
RadGrid1.MasterTableView.DataKeyNames = new string[] {"KIID"};
RadGrid1.MasterTableView.GroupLoadMode = GridGroupLoadMode.Client;
 
RadGrid1.MasterTableView.Width = Unit.Percentage(intDefaultPercentage);
RadGrid1.MasterTableView.HeaderStyle.Wrap = true;
if (isFixed)
{
    RadGrid1.CssClass = "AutoShrink";
    RadGrid1.MasterTableView.CssClass = "AutoShrink";
}
//RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
 
GridRelationFields relationFields = new GridRelationFields();
relationFields.MasterKeyField = "KIID";
relationFields.DetailKeyField = "KIID";
RadGrid1.MasterTableView.ParentTableRelation.Add(relationFields);
 
RadGrid1.ClientSettings.AllowGroupExpandCollapse = true;
GridGroupByExpression groupExpression = new GridGroupByExpression();
GridGroupByField selectField = new GridGroupByField();
//selectField.FieldAlias = "Vertical";
selectField.HeaderText = " ";
selectField.FieldName = "VerticalDisplayName";
selectField.HeaderValueSeparator = "";
GridGroupByField groupField = new GridGroupByField();
groupField.FieldName = "VerticalDisplaySequence";
groupExpression.SelectFields.Add(selectField);
groupExpression.GroupByFields.Add(groupField);
RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression);
 
#region MasterView
GridBoundColumn processColumn = new GridBoundColumn();
processColumn.UniqueName = "ProcessDescription";
processColumn.DataField = "ProcessDescription";
processColumn.HeaderText = "Process Description" + ApplicationConstant.LINEBREAK + "Key Indicator Code";
 
if (ConfigHelper.OPDashboardWidthProcess > 0)
    processColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthProcess);
 
if (ConfigHelper.OPDashboardResizeRemarks)
    processColumn.Resizable = false;
RadGrid1.MasterTableView.Columns.Add(processColumn);
 
GridBoundColumn KIColumn = new GridBoundColumn();
KIColumn.UniqueName = "KI";
KIColumn.DataField = "KIDescription";
KIColumn.HeaderText = "Key Indicator Description";
if (ConfigHelper.OPDashboardWidthKI > 0)
    KIColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthKI);
if (ConfigHelper.OPDashboardResizeRemarks)
    KIColumn.Resizable = false;
RadGrid1.MasterTableView.Columns.Add(KIColumn);
 
GridBoundColumn KIColumnHidden = new GridBoundColumn();
KIColumnHidden.UniqueName = "KIOriginal";
KIColumnHidden.DataField = "KIDescription";
if (ConfigHelper.OPDashboardWidthKI > 0)
    KIColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthKI);
KIColumnHidden.Visible = false;
RadGrid1.MasterTableView.Columns.Add(KIColumnHidden);
 
GridBoundColumn remarksColumn = new GridBoundColumn();
remarksColumn.UniqueName = "Remarks";
remarksColumn.DataField = "Remarks";
remarksColumn.HeaderText = "Remarks";
if (ConfigHelper.OPDashboardWidthRemarks > 0)
    remarksColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthRemarks);
RadGrid1.MasterTableView.Columns.Add(remarksColumn);
 
GridBoundColumn remarksColumnHidden = new GridBoundColumn();
remarksColumnHidden.UniqueName = "RemarksOriginal";
remarksColumnHidden.DataField = "Remarks";
remarksColumnHidden.Visible = false;
if (ConfigHelper.OPDashboardWidthRemarks > 0)
    remarksColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthRemarks);
RadGrid1.MasterTableView.Columns.Add(remarksColumnHidden);
 
for (int i = 1; i <= int.Parse(ConfigHelper.OPDashboardMaxPeriodRange); i++)
{
    GridTemplateColumn masterPeriodColumn = new GridTemplateColumn();
    masterPeriodColumn.UniqueName = PERIODCOLUMNPREFIX + i.ToString();
    masterPeriodColumn.ItemTemplate = new KRIPeriodTemplateColumn(i.ToString());
    masterPeriodColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
    if (ConfigHelper.OPDashboardWidthMonths > 0)
        masterPeriodColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthMonths);
    masterPeriodColumn.HeaderStyle.Wrap = true;
    if (ConfigHelper.OPDashboardResizeRemarks)
        masterPeriodColumn.Resizable = false;
    RadGrid1.MasterTableView.Columns.Add(masterPeriodColumn);
}
 
GridTemplateColumn thresholdColumn = new GridTemplateColumn();
thresholdColumn.UniqueName = "ThresholdColumn";
thresholdColumn.ItemTemplate = new KRIThresholdTemplateColumn();
thresholdColumn.Visible = blnShowThreshold;
if (ConfigHelper.OPDashboardWidthThreshold > 0)
    thresholdColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthThreshold);
//thresholdColumn.HeaderText = "Threshold";
thresholdColumn.HeaderText = "Threshold" + ApplicationConstant.LINEBREAK + "(in $)";
thresholdColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
thresholdColumn.HeaderStyle.Wrap = true;
if (ConfigHelper.OPDashboardResizeRemarks)
    thresholdColumn.Resizable = false;
RadGrid1.MasterTableView.Columns.Add(thresholdColumn);
 
#endregion
 
#region DetailView
GridTableView tableView1 = new GridTableView();
tableView1.Name = "Detail";
tableView1.DataKeyNames = new string[] { "KIID","AssetTypeCode" };
tableView1.Width = Unit.Percentage(intDefaultPercentage);
tableView1.HeaderStyle.Wrap = true;
RadGrid1.MasterTableView.DetailTables.Add(tableView1);
 
GridBoundColumn assetDescriptionColumn = new GridBoundColumn();
assetDescriptionColumn.UniqueName = "AssetTypeDescription";
assetDescriptionColumn.DataField = "AssetTypeDescription";
assetDescriptionColumn.HeaderText = "Description";
if (ConfigHelper.OPDashboardWidthProcess > 0 || ConfigHelper.OPDashboardWidthKI > 0)
    assetDescriptionColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthProcess + ConfigHelper.OPDashboardWidthKI);
tableView1.Columns.Add(assetDescriptionColumn);
 
GridBoundColumn assetTypeColumn = new GridBoundColumn();
assetTypeColumn.UniqueName = "AssetTypeCode";
assetTypeColumn.DataField = "AssetTypeCode";
assetTypeColumn.HeaderText = "Asset Type";
if (ConfigHelper.OPDashboardWidthRemarks > 0)
    assetTypeColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthRemarks);
tableView1.Columns.Add(assetTypeColumn);
 
//Pad column to align with Remarks
GridHyperLinkColumn paddingRemarksColumn = new GridHyperLinkColumn();
paddingRemarksColumn.UniqueName = "PaddingRemarksColumn";
paddingRemarksColumn.Text = "";
paddingRemarksColumn.HeaderText = "";
tableView1.Columns.Add(paddingRemarksColumn);
 
for (int i = 1; i <= int.Parse(ConfigHelper.OPDashboardMaxPeriodRange); i++)
{
    GridTemplateColumn detailPeriodColumn = new GridTemplateColumn();
    detailPeriodColumn.UniqueName = PERIODCOLUMNPREFIX + i.ToString();
    detailPeriodColumn.ItemTemplate = new KRIPeriodTemplateColumn(i.ToString());
    detailPeriodColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
    if (ConfigHelper.OPDashboardWidthMonths > 0)
        detailPeriodColumn.HeaderStyle.Width = Unit.Pixel(ConfigHelper.OPDashboardWidthMonths);
    tableView1.Columns.Add(detailPeriodColumn);
}
#endregion
 
#region Freeze Header
RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = ConfigHelper.OPDashboardFreezeHeader;
#endregion
 
#region Freeze Column
if (ConfigHelper.OPDashboardFrozenColumns > 0)
{
    RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = ConfigHelper.OPDashboardFrozenColumns;
    RadGrid1.ClientSettings.Scrolling.SaveScrollPosition = true;
}
#endregion
 
#region Resizing
if (ConfigHelper.OPDashboardResize)
{
    RadGrid1.ClientSettings.Resizing.AllowColumnResize = true;
    RadGrid1.ClientSettings.Resizing.ResizeGridOnColumnResize = false;
    RadGrid1.ClientSettings.Resizing.EnableRealTimeResize = true;
}
#endregion
Lydia
Top achievements
Rank 1
 asked on 16 Nov 2011
2 answers
137 views
OK.

This is a bit of a strange one.

I have a page with a tabstrip and multipage control on it.

When one of the tabs is selected, the pageview contains another tab strip with it's own multipage control.

Obviously, when this control shows, the tabs are all 'level one' tabs. Is it possible for me to force the tabs in this inner control to appear like 2nd level tabs?

-- 
Stuart.
Stuart Hemming
Top achievements
Rank 2
 answered on 16 Nov 2011
1 answer
270 views
I have a radgrid that successfully binds to a webservice client side via the <DataBinding> client settings section.  However I would like for the binding to occur based on an event such as a clientside click.  I'm having problems finding info/examples that do this.
Any help would be appreciated.

Thanks,
Pat
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Nov 2011
1 answer
271 views
HI,

I have a Radgrid(ASP.NET Ajax) with MasterTable and DetailTables.
I have given CommandItemTemplate in MasterTableView. Below is just the part of my code.

 

<telerik:RadGrid runat="server" ID="rgSurvey" AutoGenerateColumns="false" ShowStatusBar="true"

 

 

AllowAutomaticInserts="false" Skin="Outlook" OnItemCommand="rgSurvey_ItemCommand"

 

 

OnPreRender="rgSurvey_PreRender">

 

 

<MasterTableView DataKeyNames="SurveyID" SkinID="Outlook" Width="100%" CommandItemDisplay="Top"

 

 

Name="Survey">
<DetailTables>

 

 

<telerik:GridRelationFields DetailKeyField="SurveyID" MasterKeyField="SurveyID" />

 

 

</ParentTableRelation>

 

 

<CommandItemTemplate>

 

 

<asp:LinkButton ID="lnkAddstaff" runat="server" Text="Add Staff to Survey" CommandName="Popup"></asp:LinkButton>

 

 

</CommandItemTemplate>

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

<CommandItemTemplate>

 

 

<asp:LinkButton ID="lnkAdd" runat="server" Text="ADD" CommandName="Insert"></asp:LinkButton>

 

 

</CommandItemTemplate>


The CommandItemTemplate [CommandName="Insert"] inside the MAsterTableView is not working.. But the CommandItemTemplate inside DetailTables is working. Not sure why this is happening.

We have a asp.net Master page and Content page(Default.aspx). When using the RadGrid without a master page its working fine.
Are they any known issues when using RadGrid and MAsterTableView inside an asp.net Content page?

Regards,
Dayanithy

 

Shinu
Top achievements
Rank 2
 answered on 16 Nov 2011
2 answers
109 views
I am checking the e.Text value (RadComboBoxItemsRequestedEventArgs) in the ItemsRequested handler for a RadComboBox.  If I type in one or more characters, it works fine.  As I delete them, it works fine.  Once I delete the last character, however, the e.Text property retains the last character entered.

For example:
Enter "s" -> e.Text = "s"
Enter "sm" -> e.Text = "sm"
Delete "m" ->e.Text = "s"
Delete "s" (textbox is empty) -> e.Text still = "s"
Steve
Top achievements
Rank 1
 answered on 16 Nov 2011
1 answer
56 views
I have a grid in which I will dynamically create a column with a fixed drop down list. I dont have a datasource so how do I create a GridDropDownColumn
Princy
Top achievements
Rank 2
 answered on 16 Nov 2011
1 answer
101 views
After upgrading to a newer version, 2010.2.929.40, we are seeing the color of the text in the empty text color being rendered as black instead of gray.  Is there a workaround or fix for this?
Shinu
Top achievements
Rank 2
 answered on 16 Nov 2011
3 answers
124 views
How can i change the background color of the combobox dropdown?
Princy
Top achievements
Rank 2
 answered on 16 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?