Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
147 views
Hi,

I have the following code in the RadGrid of my UserControl:

<telerik:GridTemplateColumn UniqueName="MyColumnName" HeaderText="MyColumnName" Visible='<%# (Mode == SearchAndSelectMode.DataMode) ? true : false %>'> 
    <ItemTemplate> 
        <asp:ImageButton ID="MyButton" runat="server" ImageUrl="../App_Themes/eventIS/Grid/MyButton.gif" CommandName="DoSomething" /> 
    </ItemTemplate> 
</telerik:GridTemplateColumn> 

The "Mode" property is a public property of my UserControl, and I want to display this column depending on the value of that property. But when I run it, the following error appears:

Databinding expressions are only supported on objects that have a DataBinding event. Telerik.Web.UI.GridTemplateColumn does not have a DataBinding event.

I know it is also possible to hide the columns in code behind, but I want to do it in the ascx because then it is more clear what happens in my opinion. Is there any way to achieve what I want with the RadGrid?
Princy
Top achievements
Rank 2
 answered on 09 Dec 2009
2 answers
114 views
Hello,

I have a RadGrid with a simple definition, automaticinsert and update allowed:
<telerik:RadGrid ID="MainGrid" runat="server" SkinID="Admin" AllowPaging="True" AllowAutomaticInserts="True" 
  AllowAutomaticUpdates="True" DataSourceID="ObjectDataSourceMain"> 
  <MasterTableView DataKeyNames="Id"> 
    <Columns> 
      <telerik:GridBoundColumn HeaderText="Název katalogu" DataField="Name"> 
      </telerik:GridBoundColumn> 
      <telerik:GridBoundColumn HeaderText="Rok" DataField="Year"> 
      </telerik:GridBoundColumn> 
      <telerik:GridCheckBoxColumn HeaderText="Aktivní" DataField="IsActive"> 
      </telerik:GridCheckBoxColumn> 
    </Columns> 
  </MasterTableView> 
</telerik:RadGrid> 
<asp:ObjectDataSource ID="ObjectDataSourceMain" runat="server" OldValuesParameterFormatString="Original_{0}" 
  SelectMethod="GetCatalogs" UpdateMethod="UpdateCatalog" InsertMethod="CreateCatalog" 
  TypeName="Kooperativa.KoopObchod.Facade.ProductFacade"> 
  <UpdateParameters> 
  </UpdateParameters> 
  <InsertParameters> 
  </InsertParameters> 
</asp:ObjectDataSource> 

Everything works fine till RadAjaxManager is added:
<telerik:RadScriptManager ID="RadScriptManager" runat="server" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
  <AjaxSettings> 
    <telerik:AjaxSetting AjaxControlID="MainGrid"> 
      <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="MainGrid" /> 
      </UpdatedControls> 
    </telerik:AjaxSetting> 
  </AjaxSettings> 
</telerik:RadAjaxManager> 

Then I get client error:

"Line: 6
Error: Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation."

Insert works fine. This problem occured on all my grids.

How to find the problem? Thank you
Jiří
Top achievements
Rank 1
 answered on 09 Dec 2009
1 answer
58 views
Hi - I have a list of domain object called D with properties Name and Id as well as others.

Now, I want to have the RadPanelBar display this list of Items as follows:

[d1.Name       ^]
<TemplateItem>
showing detailed information about d1.
</TemplateItem>
[d2.Name       ^]
<TemplateItem>
showing detailed information about d2.
</TemplateItem>
etc.

I cannot get RadPanelBar to give me this list with the collapse option.

The list D's is dynamic and I currently set it directly on the DataSource property of RadPanelBar.

Can anyone point me to a solution or offer any help?

Regards
Thomas
Yana
Telerik team
 answered on 09 Dec 2009
1 answer
157 views
Alex

I want to export the RadGrid data to pdf. I can successfully export to pdf but i want to add cutomize header, footer and logo.

is there any way to achieve this requirement?

Alex
Princy
Top achievements
Rank 2
 answered on 09 Dec 2009
2 answers
120 views
Hi,

I have the scenario like, i have to use double value for MinimumValue & MaximumValue for the slider.
But this MinimumValue & MaximumValue  properties or interger.
It is there is any option to achieve  my requirement?
awaiting for your reply.

Thanks,
Kumar
THANGA KUMAR
Top achievements
Rank 1
 answered on 09 Dec 2009
1 answer
61 views
Hi:
The mastertableview in RadGrid is getting repeated as many number of times as the number of rows in the DataTable from the Database. Please find the screen shot in the attachment and help me on this issue.
   

<radG:RadGrid ID="grd" runat="server" AllowMultiRowSelection="false" HeaderStyle-Height="0"

        AllowPaging="false"  Width="100%" AllowSorting="false" AutoGenerateColumns="False"

        BorderColor="LightBlue" BorderWidth="0px" AllowMultiRowEdit="false" EnableAJAX="True"

        GridLines="None" Skin="SkeltaGrid" RadControlsDir="<%$ ReplaceTemplateExpn:telerik/radcontrols/%>"

        OnNeedDataSource="grd_NeedDataSource" OnDetailTableDataBind="grd_DetailTableDataBind" OnItemCreated="grd_ItemCreated">       

        <mastertableview name="Base" nodetailrecordstext="No records found " nomasterrecordstext="No records found"

            autogeneratecolumns="false" datasourceid="" datakeynames=""

            hierarchydefaultexpanded="false" showheader="False" >

            <Columns>

                <radG:GridTemplateColumn UniqueName="Title">

                    <ItemTemplate>

                        <asp:Label ID="Label6" runat="server" Text="Between Dates &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;"></asp:Label>

                        <asp:Label ID="FromDate" runat="server" Font-Bold="true" Text='<%# fromDateDtp.SelectedDate.Value.ToString("dd/MMM/yyyy") %>'></asp:Label>

                        <asp:Label ID="Label9" runat="server" Text="-"></asp:Label>

                        <asp:Label ID="ToDate" runat="server" Font-Bold="true" Text='<%# toDateDtp.SelectedDate.Value.ToString("dd/MMM/yyyy") %>'></asp:Label>                       

                        <br />

                        <asp:Label ID="Label10" runat="server" Text="Generated On &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;"></asp:Label>

                        <asp:Label ID="Label11" runat="server" Text='<%# DateTime.Now.ToString("dd/MMM/yyyy hh:mm tt") %>'></asp:Label>

                    </ItemTemplate>

                </radG:GridTemplateColumn>

            </Columns>

            <DetailTables>

                <radG:GridTableView Name="Agents" DataKeyNames="" AllowPaging="false" AllowMultiColumnSorting="True"

                    Width="100%" DataSourceID="" TabIndex="0" AllowAutomaticUpdates="true" HierarchyLoadMode="ServerOnDemand">                   

                    <Columns>

                        <radG:GridTemplateColumn UniqueName="RequestDate">

                            <HeaderTemplate>

                                Request Date

                            </HeaderTemplate>

                            <ItemTemplate>

                                <label>

                                    <%# Eval("Request Date")%>

                                </label>

                            </ItemTemplate>

                            <HeaderStyle HorizontalAlign="Center" Width="15%" />

                            <ItemStyle HorizontalAlign="Center" Width="15%" />

                        </radG:GridTemplateColumn>

                        <radG:GridTemplateColumn UniqueName="OpeningBalance">

                            <HeaderTemplate>

                                Opening Balance

                            </HeaderTemplate>

                            <ItemTemplate>

                                <label>

                                    <%# Eval("Opening Balance")%>

                                </label>

                            </ItemTemplate>

                            <HeaderStyle HorizontalAlign="Center" Width="15%" />

                            <ItemStyle HorizontalAlign="Center" Width="15%" />

                        </radG:GridTemplateColumn>

                        <radG:GridTemplateColumn UniqueName="UploadInflow">

                            <HeaderTemplate>

                                Upload Inflow

                            </HeaderTemplate>

                            <ItemTemplate>

                                <label>

                                    <%# Eval("Upload Inflow")%>

                                </label>

                            </ItemTemplate>

                            <HeaderStyle HorizontalAlign="Center" Width="15%" />

                            <ItemStyle HorizontalAlign="Center" Width="15%" />

                        </radG:GridTemplateColumn>

                        <radG:GridTemplateColumn UniqueName="InflowError">

                            <HeaderTemplate>

                                Inflow - Error Report

                            </HeaderTemplate>

                            <ItemTemplate>

                                <label>

                                    <%# Eval("Inflow Error Report")%>

                                </label>

                            </ItemTemplate>

                            <HeaderStyle HorizontalAlign="Center" Width="20%" />

                            <ItemStyle HorizontalAlign="Center" Width="20%" />

                        </radG:GridTemplateColumn>

                        <radG:GridTemplateColumn UniqueName="ClosedCases">

                            <HeaderTemplate>

                                Closed Cases                               

                            </HeaderTemplate>

                            <ItemTemplate>

                                <label>

                                    <%# Eval("Closed Cases")%>

                                </label>

                            </ItemTemplate>

                            <HeaderStyle HorizontalAlign="Center" Width="15%" />

                            <ItemStyle HorizontalAlign="Center" Width="15%" />

                        </radG:GridTemplateColumn>

                        <radG:GridTemplateColumn UniqueName="CarryForwardCases">

                            <HeaderTemplate>

                                Carry Forward Cases

                            </HeaderTemplate>

                            <ItemTemplate>

                                <label>

                                    <%# Eval("Carry Forward Cases")%>

                                </label>

                            </ItemTemplate>

                            <HeaderStyle HorizontalAlign="Center" Width="15%" />

                            <ItemStyle HorizontalAlign="Center" Width="15%" />

                        </radG:GridTemplateColumn>

                    </Columns>

                </radG:GridTableView>

            </DetailTables>

        </mastertableview>

        <clientsettings>

            <Selecting AllowRowSelect="false" EnableDragToSelectRows="false" />

        </clientsettings>

        <exportsettings exportonlydata="true" filename="Summary Report" ignorepaging="true"

            openinnewwindow="true">

        </exportsettings>

    </radG:RadGrid>

 

 

 

protected void grd_NeedDataSource(object source, Telerik.WebControls.GridNeedDataSourceEventArgs e) {

        this.Impersonate(InsuranceProcessLib.SPSettings);

        try {

            DataTable dt = InsuranceProcessLib.GetSummaryReport(Convert.ToDateTime(fromDateDtp.SelectedDate.Value), Convert.ToDateTime(toDateDtp.SelectedDate.Value));

            //grd.MasterTableView.HierarchyDefaultExpanded = true;

            grd.DataSource = dt;           

        } finally {

            this.UndoImpersonation();

        }

    }

 

    protected void grd_DetailTableDataBind(object source, Telerik.WebControls.GridDetailTableDataBindEventArgs e) {

        if (_DataViews.Contains(e.DetailTableView)) return;

        _DataViews.Add(e.DetailTableView);

        e.DetailTableView.DataSource = InsuranceProcessLib.GetSummaryReport(Convert.ToDateTime(fromDateDtp.SelectedDate.Value), Convert.ToDateTime(toDateDtp.SelectedDate.Value));

        e.DetailTableView.DataBind();

        _DataViews.Remove(e.DetailTableView);

    }

 

    protected void grd_ItemCreated(object source, Telerik.WebControls.GridItemEventArgs e) {

        if (e.Item.OwnerTableView.Name.Equals("Base")) {

            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) {

                e.Item.BackColor = System.Drawing.Color.LightCyan;

            }

        }

    }   

 

    protected void btnGo_Click(object sender, EventArgs e) {

        grd.Rebind();

        exportToExcelImgBtn.Visible = true;       

        excelExportLbl.Visible = true;       

    }

Daniel
Telerik team
 answered on 09 Dec 2009
19 answers
583 views
Hi,

Attached is a screenshot of a confirm dialog in Q2 and Q3. The style for the cancel button is missing?

eyal
CSurieux
Top achievements
Rank 2
 answered on 09 Dec 2009
5 answers
333 views
We need a FileBrowserContentProvider Sample.

I can't find a documentation about FileExplorer.

The demo is very poor :(

Please help.

Thanks.

Fiko
Telerik team
 answered on 09 Dec 2009
1 answer
438 views
Hi All,

I really need to know how to load the treeview on the client using JSON. All I've seen is using an XML file and this will not fit the bill for my needs. It would seem rather wastefull to take a JSON string and create an XML file out of it just to load the treeview on the client side. Any assistnace, code, snips or links to other articles would be terrific as  I need to figure this out asap.

With regards and advance thanks

Craig T
Veselin Vasilev
Telerik team
 answered on 09 Dec 2009
0 answers
122 views
Hi All,

I am implementing the Rad Scheduler Control by creating the Appointments through Drag and Drop feature.I implemented a Advance Edit Form where i took two comboboxes with tasks and the BreakTime...
and on the top of the scheduler i took 3 buttons TaskView,BreakView and Shift(appointment)View.
so when ever i click on the button the subject of the appointement should be updated based on the selected one.(say if i clicked on the task view ,the subject field should contain the tasks assigned for that appointment).I tried it writting the code inside the appointment -created event but i am getting the error as "Collection was modified; enumeration may not execute " I dont know the reason why i am gettiing this..
Here is the code i implemented..

protected

 

void RSchedulerTemplate_OnAppointmentCreated(object sender, AppointmentCreatedEventArgs e)
{  

 

ViewScheduler(

string ViewType);
}
private
void ViewScheduler(string ViewType)
{

 

for (int i = 0; i < DRMSession.DTScheduler.Rows.Count; i++)
{

 

ShiftDetails sDetails = GetShiftData(DRMSession.DTScheduler.Rows[i]["schedulerid"].ToString());  

 

 

 

 

// assign startOffSet hours and minutes 

 

TimeSpan startTime = TimeSpan.FromTicks(sDetails.startOffset);

 

TimeSpan endTime = TimeSpan.FromTicks(sDetails.Duration);

 

TimeSpan startOffSet = new TimeSpan(startTime.Hours, startTime.Minutes, 0);

 

DateTime startOffSetDate = new DateTime(startOffSet.Ticks);

 

// assign duration hours and minutes  

 

 

TimeSpan duration = new TimeSpan(endTime.Hours, endTime.Minutes, 0);

 

DateTime durationDate = new DateTime(duration.Ticks);

 

// startOffSet and duration formatting result

 

string startOffSetResult = startOffSetDate.ToString("hh:mm tt");

 

string durationResult = durationDate.ToString("hh:mm tt");

 

string jobGroupName = string.Empty;

 

foreach (JobGroup jGroup in JobGroups)
{

 

 

if (jGroup.Id == sDetails.jobGroupId) {

jobGroupName = jGroup.Name;

 

break; }

 

}

 

switch (ViewType) {

 

case "Shift":

 

 {

 

DRMSession.DTScheduler.Rows[i]["name"] = jobGroupName + " # " + startOffSetResult + " - " + durationResult;

 

 }

 

break;

 

 

case "Task":

 

 { 

 

if (sDetails.LstTaskIds.Count > 0)  

{

 

string tasksList = string.Empty;

 

 

foreach (Task tsk in Tasks)

 

 {

 

foreach (int taskId in sDetails.LstTaskIds)

 

 {

 

if (tsk.Id == taskId)

 

 {

tasksList +=

Environment.NewLine + tsk.Title;

 

 }

}

}

 

DRMSession.DTScheduler.Rows[i]["name"] = jobGroupName + Environment.NewLine + " # " + startOffSetResult + " - " + durationResult + Environment.NewLine + tasksList;

 

 }

}

 

break;

 

 

case "Break":

 

 {

 

if (sDetails.LstBreakIds.Count > 0)

 

 {

 

string breakTypes = string.Empty;

 

 

foreach (BreakType bType in BreakType)

 

 {

 

for (int Cnt = 0; Cnt < sDetails.LstBreakIds.Count; Cnt++)

 

 {

 

if (sDetails.LstBreakIds[Cnt] == bType.Id)

 

 {

breakTypes +=

Environment.NewLine + bType.Type + "-" + DateTime.Parse(sDetails.LstBreakTime[Cnt].ToString()).TimeOfDay;

 

}

}

}

 

DRMSession.DTScheduler.Rows[i]["name"] = jobGroupName + Environment.NewLine + " # " + startOffSetResult + " - " + durationResult + Environment.NewLine + breakTypes;

 

 }

}

 

break;

 

 }

}

RSchedulerTemplate.DataSource =

DRMSession.DTScheduler;  

 

RSchedulerTemplate.Rebind();

}

 

protected void btnShiftView_Click(object sender, EventArgs e)

 

 {

ViewType =

"Shift";  

 

ViewScheduler(ViewType);

}

 

protected void btnTaskView_Click(object sender, EventArgs e)

 {

ViewType =

"Task";

 

 ViewScheduler(ViewType);

}

 

protected void btnBreakView_Click(object sender, EventArgs e)

 

 {

ViewType =

"Break";

 

 ViewScheduler(ViewType);

}
This is a crucial requirement. Appreciate any help in this regard.

 

 

 

chaitanya elluri
Top achievements
Rank 1
 asked on 09 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?