Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
116 views

Hello all,

I have a hard issue with a Telerik RadGrid, when I use a templateColumn and put <%# Eval("something") %> me table brokes!

 

My ASP Code:

<telerik:RadGrid ID="RadGrid1" runat="server"  AutoGenerateColumns="false">
    <MasterTableView HierarchyLoadMode="Client" DataKeyNames="id" ClientDataKeyNames="id" NoMasterRecordsText="No existen registros a mostrar.">
        <Columns>
            <telerik:GridBoundColumn DataField="nombre" UniqueName="nombre" HeaderText="Nombre" />
            <telerik:GridTemplateColumn HeaderText="Tipo">
                <ItemTemplate>
                    <p><%# Eval("tipo") %></p>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
             <telerik:GridBoundColumn DataField="creacion" UniqueName="creacion" HeaderText="Creación" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

 

My broken table:

http://puu.sh/qpuB9/7a12a67e1c.png

My table without Eval:

http://puu.sh/qpuDh/a9f06c406d.png

 

HELP PLZ!

 

Thz for your time.

Konstantin Dikov
Telerik team
 answered on 08 Aug 2016
1 answer
161 views
<FooterTemplate>
    <div>
        <asp:Button ID="btnOk" OnClientClick="" Text="OK" runat="server" />
        <asp:Button ID="btnCancel" Text="Cancel" runat="server" />
    </div>
</FooterTemplate>

 

I add two buttons in the dropdowntree via FooterTemplate, how to close the dropdowntree using javascript when users click Ok or Cancel buttons

Ivan Danchev
Telerik team
 answered on 08 Aug 2016
3 answers
301 views
According to Telerik's documentation for ASP.NET Ajax Controls 2010 Q1's RadGrid -

"The value of the TableLayout property is a string that specifies or receives one of the following GridTableLayout enumeration values:

Auto Column width is set by the widest unbreakable content in the column cells.
Fixed Default. Table and column widths are set either by the sum of the widths on the GridTableView.Columns objects or, if these are not specified, by the width of the first row of cells. If no width is specified for the table, it renders by default with width=100%."

I have a table that has its TableLayout to fixed.  I have 3 columns - all have fixed widths.  Yet when I view the source, the rendered table has a width of 100% and the 3 columns have the same width (they are each a third of the grid).   According to Telerik's documentation, that should not be the case. 

 What is going on?

Here is my exact markup of the RadGrid:
<telerik:RadGrid ID="dgCourseCatalog" runat="server" AutoGenerateColumns="False" AllowSorting="true" BorderStyle="None"
                    <MasterTableView ShowHeadersWhenNoRecords="False" AllowNaturalSort="false" TableLayout="Fixed"
                        <SortExpressions> 
                            <telerik:GridSortExpression FieldName="LearningModuleName" SortOrder="Ascending" /> 
                        </SortExpressions> 
                        <NoRecordsTemplate> 
                            <div class="StatusUpdate Warning NoRecords"
                                No Learning Modules found with your search criteria. Please adjust your search. 
                            </div> 
                        </NoRecordsTemplate> 
                        <Columns> 
                            <telerik:GridTemplateColumn HeaderText="Type" UniqueName="LMType" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            <ItemStyle Width="30px" Wrap="true" /> 
                                <ItemTemplate> 
                                    <img src='<%#ResolveUrl(Eval("LMTypeIconUrl"))%>' alt='<%#Eval("LMTypeDescription") %>' /> 
                                </ItemTemplate> 
                            </telerik:GridTemplateColumn> 
                            <telerik:GridHyperLinkColumn HeaderText="Name" DataTextField="LearningModuleName" SortExpression="LearningModuleName" DataNavigateUrlFormatString="~/learning/learningmodulehome.aspx?LMID={0}" 
                                DataNavigateUrlFields="LearningModuleID" UniqueName="LearningModuleName" ItemStyle-Width="250px" ItemStyle-Wrap="true" /> 
                            <telerik:GridBoundColumn HeaderText="Description" DataField="LearningModuleDescription" UniqueName="LearningModuleDescription" 
                                SortExpression="LearningModuleDescription" ItemStyle-Width="250px" ItemStyle-Wrap="true" /> 
                        </Columns> 
                    </MasterTableView> 
                </telerik:RadGrid> 

Maria Ilieva
Telerik team
 answered on 08 Aug 2016
0 answers
70 views

Hi

I am using Telerik Radeditor and in my application, I want to show the content from editor to the div.

But my application's base css is changing the UI of the editor content which I am rendering in the div. Is there any way, I can apply the editor's css to my div? So that I can get the same look and feel to the div as well

Thanks in advance.

Avinash
Top achievements
Rank 1
 asked on 08 Aug 2016
12 answers
300 views
Looking through a few of my telerik projects and can see the following javascript errors showing up quite a lot.

Exception was thrown at line 1128, column 9009 in http://localhost:49573/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:c9cbdec3-c810-4e87-846c-fb25a7c08002:ea597d4b:b25378d2;Telerik.Web.UI:en-US:9711a23a-6cf5-4e6c-87f5-29e6585b3026:16e4e7cd:f7645509:22a6274a:86526ba7:874f8ea2:ed16cbdc:b7778d6c:c08e9f8a:e085fe68:82923ac3:1bb784d4
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 1128, column 9238 in http://localhost:49573/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:c9cbdec3-c810-4e87-846c-fb25a7c08002:ea597d4b:b25378d2;Telerik.Web.UI:en-US:9711a23a-6cf5-4e6c-87f5-29e6585b3026:16e4e7cd:f7645509:22a6274a:86526ba7:874f8ea2:ed16cbdc:b7778d6c:c08e9f8a:e085fe68:82923ac3:1bb784d4
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 4, column 9009 in http://localhost:49573/ScriptResource.axd?d=mbGZm65DzNC0tMTq0Elbcc2M1lDuhchN4BXVn4uPZtnyhlRXLPnt-p-dAYxFV7TeQsitN7kLc7Oz6BpWqdRbINK33ULDqonSEovmFOF83pRjvHvKgGo7T1rrGIJbqjjyBiTz_w2&t=ffffffffbde351db
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 4, column 9238 in http://localhost:49573/ScriptResource.axd?d=mbGZm65DzNC0tMTq0Elbcc2M1lDuhchN4BXVn4uPZtnyhlRXLPnt-p-dAYxFV7TeQsitN7kLc7Oz6BpWqdRbINK33ULDqonSEovmFOF83pRjvHvKgGo7T1rrGIJbqjjyBiTz_w2&t=ffffffffbde351db
0x800a139e - JavaScript runtime error: SyntaxError


I generally have a RadFormDecorator and RadAjaxManager.  If I remove these, the errors go away.  Any more detail on this?
Maria Ilieva
Telerik team
 answered on 08 Aug 2016
1 answer
306 views

GridExcelExportFormat.Xlsx:

Problems using german special characters like ö ä ü, will be exported as HTML special character &xxx (see screen1.png)

Why?
Maria Ilieva
Telerik team
 answered on 08 Aug 2016
1 answer
68 views

So, I'm trying to use the tab strip and while I know it should be a five minute item, it's turned into a nightmare.  Essentially, all I ever get is the first tab and pageview, the tabs don't respond and the pageview doesn't change.  What am I doing wrong?

<telerik:RadAjaxManager runat="server" >

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="RadMultiPage1">

<UpdatedControls><telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />

<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /></UpdatedControls></telerik:AjaxSetting><telerik:AjaxSetting AjaxControlID="RadTabStrip1" ><UpdatedControls><telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /><telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /></UpdatedControls></telerik:AjaxSetting></AjaxSettings></telerik:RadAjaxManager>

<telerik:RadTabStrip ID="RadTabStrip1" runat="server"MultiPageID="RadMultiPage1" SelectedIndex="0">

<Tabs>

<telerik:RadTab runat="server" PageViewID="RadPageView1" Text="A" >

</telerik:RadTab>

<telerik:RadTab runat="server" PageViewID="RadPageView2" Text="B">

</telerik:RadTab>

<telerik:RadTab runat="server" PageViewID="RadPageView" Text="C">

</telerik:RadTab>

</Tabs>

</telerik:RadTabStrip>

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">

<telerik:RadPageView ID="RadPageView1" runat="server" Width="100%" >` CONTENT HERE

</telerik:RadPageView>

<telerik:RadPageView ID="RadPageView2" runat="server" Width="100%">` CONTENT HERE

</telerik:RadPageView>

<telerik:RadPageView ID="RadPageView3" runat="server" Width="100%">` CONTENT HERE

</telerik:RadPageView>

</telerik:RadMultiPage>

Thank you!

Veselin Tsvetanov
Telerik team
 answered on 08 Aug 2016
15 answers
387 views
I have multiple RadListBoxes and I want to enable Drag and Drop between them. I found a KB article describing how do to this. I downloaded it and it "works". That is to say you can drag items from any list box and drop them on any other. What the demonstration doesn't show is how to make these changes appear back on the server. Ultimately I want the server to remember the new configuration of ListBoxes. Is there a simple way to achieve this?

The KB article I referred to is here

Martin
Fatma
Top achievements
Rank 1
 answered on 06 Aug 2016
2 answers
189 views

So I have a grid with a "custom" editform.  The form opens fine, the cancel button works but when I click on "Update"... nothing. Setting a breakpoint on the event, it's not even firing.  I'd really appreciate any suggestion on what I'm doing wrong. 

My XAML is:

<telerik:RadGrid ID="pendingVehiclesRadGrid" runat="server" AutoGenerateColumns="False"
CellSpacing="0" GridLines="None" AllowPaging="True"
onneeddatasource="pendingVehiclesRadGrid_NeedDataSource"
OnUpdateCommand="pendingVehiclesRadGrid_UpdateCommand"
onitemcommand="pendingVehiclesRadGrid_ItemCommand" >
<MasterTableView DataKeyNames="status,charity,make,model,year,vin,date,id,salePrice,bid,note"
EditMode="EditForms" PageSize="20">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridButtonColumn CommandName="History" Text="History" UniqueName="detailBtn" HeaderText="History" HeaderButtonType="PushButton" AutoPostBackOnFilter="True">
</telerik:GridButtonColumn>
<telerik:GridBoundColumn HeaderText="Charity" ItemStyle-Width="140px" FilterControlAltText="Filter column2 column"
UniqueName="column3" DataType="System.String" DataField="charity" ReadOnly="True">
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="VIN" ItemStyle-Width="140px" FilterControlAltText="Filter column6 column"
UniqueName="column7" DataType="System.String" DataField="vin" >
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Year" ItemStyle-Width="140px" FilterControlAltText="Filter column2 column"
UniqueName="column2" DataType="System.Int32" DataField="year">
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Make" ItemStyle-Width="140px" FilterControlAltText="Filter column column"
UniqueName="column" DataType="System.String" DataField="make">
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Model" ItemStyle-Width="140px" FilterControlAltText="Filter column1 column"
UniqueName="column1" DataType="System.String" DataField="model">
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Last Update" ItemStyle-Width="140px" FilterControlAltText="Filter column1 column"
UniqueName="column5" DataType="System.DateTime" DataField="date" ReadOnly="True">
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Min. Bid" ItemStyle-Width="140px" FilterControlAltText="Filter column1 column"
UniqueName="column8" DataType="System.Decimal" DataField="bid" DataFormatString="{0:C}" >
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Sale Price" ItemStyle-Width="140px" FilterControlAltText="Filter column1 column"
UniqueName="column6" DataType="System.Decimal" DataField="salePrice" DataFormatString="{0:C}" Display="False">
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Notes" ItemStyle-Width="140px" FilterControlAltText="Filter column1 column"
UniqueName="unsoldNotesColumn" DataType="System.String" DataField="note" Display="True">
<ItemStyle Width="140px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Latest Status" ItemStyle-Width="240px">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "Status")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox RenderMode="Lightweight" runat="server" ID="pendingVehiclesRadGridupdateComboBox" DataTextField="Status"
DataValueField="ID" DataSourceID="LinqDataSource1" >
</telerik:RadComboBox>
</EditItemTemplate>
<ItemStyle Width="240px"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="pendingVehiclesRadGridEditCommandColumn"
HeaderText="Edit" HeaderStyle-Width="100px" UpdateText="Update">
<HeaderStyle Width="100px"></HeaderStyle>
</telerik:GridEditCommandColumn>


</Columns>
<EditFormSettings EditColumn-DataType="System.String">
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>

My codebehind looks like this:

private void LoadpendingVehicleRadGrid()
{

CAAData2DataContext db = new CAAData2DataContext();
var validStatuses = new[] { "Assigned", "Donor Called", "Dispatched", "Waiting",
"Title Rec'd", "Sending Title", "Cancelled", "Waiting"};
var ud = db.Updates
.Where(c => !c.Sold)
.GroupBy(c => c.Vehicle, x => x, (x, gr) => new
{
key = x,
list = gr.ToList().OrderByDescending(z => z.TimeStamp).First()
})
.Where(x => validStatuses.Contains(x.list.Status))
.Select(x => x.list).ToList();
var unSoldVehicles = (from u in ud
join v in db.Vehicles on
u.Vehicle equals v.ID
join c in db.Customers on
v.Charity equals c.ID
select new
{
status = u.Status,
make = v.Make,
model = v.Model,
Year = v.Year,
vin = v.VIN_,
charity = c.Name,
date = u.TimeStamp,
id = u.Vehicle,
salePrice = v.SalePrice,
bid = v.MinimumBid,
note = u.Note
}).OrderBy(z => z.charity).ToList();
pendingVehiclesRadGrid.DataSource = unSoldVehicles;



}

protected void pendingVehiclesRadGrid_UpdateCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "Update")
{
GridEditableItem item = (GridEditableItem)e.Item;
RadComboBox combo = (RadComboBox)item.FindControl("pendingVehiclesRadGridupdateComboBox");
String note = (item["unsoldNotesColumn"].Controls[0] as TextBox).Text;
var status = (string)item.GetDataKeyValue("status");
if (combo.SelectedItem.Text != status)
{
if (combo.SelectedItem.Text == "Vehicle Sold")
{
CAAData2DataContext dc = new CAAData2DataContext();
Update soldUpdate = new Update();
soldUpdate.Note = note;
soldUpdate.Status = combo.SelectedItem.Text.ToString();
soldUpdate.TimeStamp = DateTime.Now;
soldUpdate.Vehicle = (int)item.GetDataKeyValue("id");
soldUpdate.UpdatedBy = "Paul";
dc.Updates.InsertOnSubmit(soldUpdate);
dc.SubmitChanges();
var vehicleSold = from u in dc.Updates
where u.Vehicle == (Int32)item.GetDataKeyValue("id")
select u;
foreach (Update u in vehicleSold.ToList())
{
u.Sold = true;
}
dc.SubmitChanges();
var vehiclePrice = from v in dc.Vehicles
where v.ID == (Int32)item.GetDataKeyValue("id")
select v;
Vehicle soldVehicle = vehiclePrice.ToList().FirstOrDefault();
GridEditableItem editedItem = e.Item as GridEditableItem;
String price = (editedItem["Column6"].Controls[0] as TextBox).Text;
decimal salePrice = Convert.ToDecimal(price);
soldVehicle.SalePrice = salePrice;
dc.SubmitChanges();

}
else
{
CAAData2DataContext db = new CAAData2DataContext();
Update newUpdate = new Update();
newUpdate.Status = combo.SelectedItem.Text.ToString();
newUpdate.TimeStamp = DateTime.Now;
newUpdate.Vehicle = (int)item.GetDataKeyValue("id");
newUpdate.UpdatedBy = "Paul";
newUpdate.Note = note;
db.Updates.InsertOnSubmit(newUpdate);
db.SubmitChanges();

}


}

}
}

protected void pendingVehiclesRadGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item.IsInEditMode)
{
GridEditableItem editItem = (GridEditableItem)e.Item;
RadComboBox combo = (RadComboBox)editItem.FindControl("pendingVehiclesRadGridComboBox");
combo.DataBind();
combo.SelectedValue = DataBinder.Eval(editItem.DataItem, "ID").ToString();
}
}

Thanks in advance... I'm under a lot of pressure to get this working and beats me what's wrong...



Paul
Top achievements
Rank 1
Iron
 answered on 05 Aug 2016
1 answer
96 views

Hi telerik

here is my scenario:

I have a textbox a submit button and two grids in one page

in textbox, users have to insert a name and in that two grids insert some rows

after user pushes submit button all grids rows and textbox's value must insert into database and two grids have to connect whit the textbox record's id;

actually I'm trying to do all these process by just one click

so is there any recommendation to do this?

Kasra
Top achievements
Rank 1
 answered on 05 Aug 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?