Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
163 views
hello,

   I have a grid that when I am setting its edit column button type of imageButton,like this:
 
<telerik:GridButtonColumn UniqueName="Delete" ImageUrl="~/Images/NewDesign/icons-table-delete.png" ButtonType =ImageButton CommandName="Delete" >

</telerik:GridButtonColum

if ButtonType =ImageButton Button doesn't get to RadGrid1_ItemCommand

I know the solution:
to do DataBind if not postback.

But to me it does not help, because I have a search button each time to refresh the data grid and must be DataBind even in case postback.

What should I do?(My code in vb.net)

Thanks Ayelet

Pavlina
Telerik team
 answered on 19 Sep 2011
0 answers
58 views
Hello,

I'm using 2 radgrids (pending orders - shipped orders) with drag and drop rows feature. I would like to save the data of the second grid (shipped orders) to a database table, insert, update and delete rows and export all the rows to an excel file. How could i make this; I would be much grateful, if you provide me some sample of code along with the information.

Thank you very much.
George
Top achievements
Rank 1
 asked on 19 Sep 2011
5 answers
138 views
Hi
I'm using Radgrid and its working fine.
I have one requirement.

In my radrgid I have the column called "Description" and it will contain huge text.
But in grid it showing the some of the content only.
Can I break the lines after some characters like after 20 characters like that.
I have used Itemstyle-width and headerstyle-width but nothing has worked.

please help me how to resolve this issue.
Winni
Top achievements
Rank 1
 answered on 19 Sep 2011
1 answer
88 views
How do i add appointments from within code-behind. Something like the following:

Dim startdate As DateTime = DateTime.Parse("9/16/2011")
        For i As Integer = 1 To 12
            startdate = startdate.AddMonths(1)
            ' pseudo code:
                  MyScheduler.Appointments.Add(startdate)
        Next

Meaning, no source code (database, generic list etc. etc.). Just a simple loop.

Thank you
Ivana
Telerik team
 answered on 19 Sep 2011
1 answer
108 views
Dear Al,

Currently I'm building a Form which dynamicly renders all the properties for a object. Therefore I create RadTabStrip and MultiPage both programmaticly I can in the rendered html that everything is created, however I am unable to switch the pages using the tabstrip.

What's going wrong overhere?

Thanks in advance


// First create the required means
 MultiPageStrip = new RadMultiPage() { ID = "Object_Form$MultiPageStrip", ClientIDMode = System.Web.UI.ClientIDMode.Static };
 TabStrip = new RadTabStrip() { MultiPageID = "Object_Form$MultiPageStrip" };

// Now is the beautifull part, we are going to generate the controls, we can that easily using the describtor
 foreach (Tab Tab in this.DataSource.MetaData.UserInterfaceDescriptor.Tabs)
 {
     RadPageView PageView = new RadPageView() { ID = "Object_Form$MultiPageStrip_Tab_" + TabStrip.Tabs.Count.ToString() };
     RadTab RadTab = new RadTab(Tab.Name) { PageViewID = "Object_Form$MultiPageStrip_Tab_" + TabStrip.Tabs.Count.ToString() };
     RenderTab(Tab, PageView);
     MultiPageStrip.PageViews.Add(PageView);
     TabStrip.Tabs.Add(RadTab);
 }
 
 // And add the create controls
 TabStrip.SelectedIndex = 0;
 MultiPageStrip.SelectedIndex = 0;
 ControlPanel.Controls.Add(TabStrip); ControlPanel.Controls.Add(MultiPageStrip);


Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Sep 2011
1 answer
139 views
Hi,

I've been looking/following this demo:http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultcs.aspx

At the moment I just have one column, the following is returned from my webservice. I'm using an alert to display the webservice result.
function updateGrid(result)
      
          var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
          tableView.set_dataSource(result);
          tableView.dataBind(); 
            
          var grid = $find("<%= RadGrid1.ClientID %>");
          grid.repaint();
      }
result returns this in the alert box
[{"Test_PK":1},{"Test_PK":58}]
when it databinds it clears the grid, but if I do var result = [{"Test_PK":1},{"Test_PK":58}];
it works fine?

Any idea what I'm missing?

Thanks

Karl
Top achievements
Rank 1
 answered on 19 Sep 2011
2 answers
132 views
Hi All,
How can remove decimal number from y axis and just display integer numbers????
thanks All
ghadeer
Top achievements
Rank 1
 answered on 19 Sep 2011
1 answer
61 views
Sorry I could not work out where to post this as I dont understand telerik terminology well enough yet!!

I have a RadFilter and a RadGrid on my page.  If I set the DataSourceControls explicitly, it works fine..

 

 

 

 

<asp:EntityDataSource ID="EntityDataSource1" runat="server" 
            ConnectionString="name=Clarity2011Entities"  OrderBy="it.[DisplayName]"
            DefaultContainerName="Clarity2011Entities" EnableFlattening="False" 
            EntitySetName="tblMassMaintenanceFields" 
              
            Select="it.[FieldId], it.[DisplayName], it.[FieldName], it.[TableName], it.[NetDataType]" 
            EntityTypeFilter="tblMassMaintenanceField">
        </asp:EntityDataSource>
        <div class="filterDiv">
            <telerik:RadFilter runat="server" ID="RadFilter1" OnPreRender="RadFilter1_PreRender" DataSourceControlID="EntityDataSource1" FilterContainerID="RadGrid1" ShowApplyButton="false" />
            <asp:SqlDataSource ID="dtcRadGrid1" runat="server" ConnectionString="<%$ ConnectionStrings:BRINVConnectionString %>" CancelSelectOnNullParameter="False"   SelectCommand="Select  DisplayName FROM tblMassMaintenanceFields">
              </asp:SqlDataSource>
  
        </div>
        <telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="False"   
            AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" 
            OnItemCommand="RadGrid1_ItemCommand" CellSpacing="0" GridLines="None">
            <MasterTableView IsFilterItemExpanded="false" CommandItemDisplay="Top" 
               >
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
  
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
  
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
  
                <Columns>
                    <telerik:GridBoundColumn DataField="FieldId" DataType="System.Int32" 
                        FilterControlAltText="Filter FieldId column" HeaderText="FieldId" 
                        ReadOnly="True" SortExpression="FieldId" UniqueName="FieldId">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DisplayName" 
                        FilterControlAltText="Filter DisplayName column" HeaderText="DisplayName" 
                        ReadOnly="True" SortExpression="DisplayName" UniqueName="DisplayName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FieldName" 
                        FilterControlAltText="Filter FieldName column" HeaderText="FieldName" 
                        ReadOnly="True" SortExpression="FieldName" UniqueName="FieldName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="TableName" 
                        FilterControlAltText="Filter TableName column" HeaderText="TableName" 
                        ReadOnly="True" SortExpression="TableName" UniqueName="TableName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="NetDataType" 
                        FilterControlAltText="Filter NetDataType column" HeaderText="NetDataType" 
                        ReadOnly="True" SortExpression="NetDataType" UniqueName="NetDataType">
                    </telerik:GridBoundColumn>
                </Columns>
  
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
                <CommandItemTemplate>
                    <telerik:RadToolBar runat="server" ID="RadToolBar1" OnButtonClick="RadToolBar1_ButtonClick">
                        <Items>
                            <telerik:RadToolBarButton Text="Apply filter" CommandName="FilterRadGrid" ImageUrl="<%#GetFilterIcon() %>"
                                ImagePosition="Right" />
                        </Items>
                    </telerik:RadToolBar>
                </CommandItemTemplate>
                  
            </MasterTableView>
  
<FilterMenu EnableImageSprites="False"></FilterMenu>
  
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
        </telerik:RadGrid>

But when I write code to create the entitydatasource I get object not set to instance of an object when the page displays..
Here is the code:

EntityDataSource ClarityEntities = new EntityDataSource();
var conEntitiesString = ConfigurationManager.ConnectionStrings["Clarity2011Entities"];
string strConnEntitiesString = conEntitiesString.ConnectionString;
ClarityEntities.ConnectionString = strConnEntitiesString;
ClarityEntities.OrderBy = "it.[DisplayName]";
ClarityEntities.EnableFlattening = false;
ClarityEntities.DefaultContainerName = "Clarity2011Entities";
//ClarityEntities.ContextTypeName =
ClarityEntities.EntitySetName = "tblMassMaintenanceFields";
ClarityEntities.Select =  "it.[FieldId], it.[DisplayName], it.[FieldName], it.[TableName], it.[NetDataType]";
ClarityEntities.EntityTypeFilter = "tblMassMaintenanceField";
RadGrid1.DataSource = ClarityEntities;
RadGrid1.MasterTableView.DataSource = ClarityEntities;
I thought the above code was the equivalent of the entitydatasource I created in the tag above?  What is different?

Sorry I am a newbie so am probably missing something obvious

TIA
Mira
Telerik team
 answered on 19 Sep 2011
1 answer
69 views
I am having issues everyday with telerik controls  and have no more time to do research and find answers,
looks like we mistakenly thought that telerik controls are not just cool looking but also easy to use (well they are easy to use with datasource controls which we can not use). By some reason
our client still did not purchase controls and I am forced to use public forum for help, I am spending more time on user interface then on business side and we going down as deadline closing in, at the moment I can surely say that in the last two weeks I would have done 30% more in notepad/php and javascript and would get close on completion but clients insists on  "cool" and .net. I am going to halt development until I get access to premium support but would like to know how fast it is for paid customers, I can not wait for an answers all day.
Georgi Tunev
Telerik team
 answered on 19 Sep 2011
1 answer
70 views
I am using Linq queries as my datasource and using gridboundcolums on my radgrid. Whenever I go to sort or page the dataon the radgrid dissapears completely.


  <telerik:RadGrid ID="gridDpSummary" runat="server" CellSpacing="0"
  GridLines="None" EnableEmbeddedSkins="False" Skin="dpgrid" AllowSorting="True"
  AllowPaging="True" PageSize="20" onneeddatasource="gridDpSummary_NeedDataSource">
    <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
    <MasterTableView>
      <Columns>
        <telerik:GridBoundColumn FilterControlAltText="Filter columnVoyage column"
          HeaderText="Voyage" UniqueName="columnVoyage" DataField="voyageID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter columnStartDate column"
          HeaderText="Start Date" UniqueName="columnStartDate" DataField="date">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter columnEndDate column"
          HeaderText="End Date" UniqueName="columnEndDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter columnVessel column"
          HeaderText="Vessel" UniqueName="columnVessel" DataField="vesselName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter columnFacility column"
          HeaderText="Facility" UniqueName="columnFacility" DataField="facilityName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter columnDPType column"
          HeaderText="DP Type" UniqueName="columnDPType">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter columnTotalHours column"
          HeaderText="Total Hours" UniqueName="columnTotalHours">
        </telerik:GridBoundColumn>
      </Columns>
    </MasterTableView>
    <PagerStyle Mode="NextPrevAndNumeric" />
    <FilterMenu EnableTheming="true">
      <CollapseAnimation Duration="200" Type="OutQuint" />
    </FilterMenu> 
</telerik:RadGrid>

My NeedDataSource Event
protected void gridDpSummary_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) {
                int companyID = Convert.ToInt32(parameters.companyID);
                DateTime startDate = Convert.ToDateTime(parameters.startDate);
                DateTime endDate = Convert.ToDateTime(parameters.endDate);
                endDate = endDate.AddDays(1);
 
                var voyIDQuery = from vl in dc.lkpVoyageLegs
                                 join vc in dc.lkpVoyageCompanies on vl.voyageID equals vc.voyageID
                                 where vc.companyID == companyID
                                 && vl.aDateTime >= startDate
                                 && vl.aDateTime < endDate
                                 && vl.isEnd == true
                                 select vl.voyageID;
 
 
 
                var dpQuery = from vl2 in dc.lkpVoyageLegs
                              join dpt in dc.utlDPTypes on vl2.dpTypeID equals dpt.dpTypeID
                              join voy in dc.dtaVoyages on vl2.voyageID equals voy.ID
                              join ves in dc.dtaVessels on voy.vesselID equals ves.vesselID
                              join fac in dc.dtaFacilities on vl2.facilityID equals fac.facilityID
                              where voyIDQuery.Contains(vl2.voyageID)
                              select new { voyageID = vl2.voyageID, vesselName = ves.name, facilityName = fac.name, date = vl2.aDateTime };
 
                gridDpSummary.DataSource = dpQuery;
            }

Tsvetina
Telerik team
 answered on 19 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?