Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
128 views
I don't know why _InsertCommand not fired in this grid

<

telerik:RadGrid ID="Grid" runat="server" Skin="Outlook" GridLines="None" EnableAjaxSkinRendering="true">

<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="ID" TableLayout="Fixed">

<CommandItemTemplate>

<asp:LinkButton ID="lnkBtnAddData" runat="server" CommandName="InitInsert" Visible="true"><img style="border:0px;vertical-align:middle;" alt="" src="../images/AddRecord.Gif" />

<asp:Literal ID="litAddData" runat="server" Text="Ajouter une donn‚e"></asp:Literal>

</asp:LinkButton>

</CommandItemTemplate>

<Columns>

<telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText="Annuler la modification de la donn‚e"

UniqueName="EditCommandColumn" CancelImageUrl="../RadControls/Grid/Skins/Outlook/Cancel.Gif"

FilterImageUrl="" InsertText="Ajouter une donn‚e" InsertImageUrl="../RadControls/Grid/Skins/Outlook/Update.Gif"

SortAscImageUrl="" SortDescImageUrl="" UpdateText="Mettre … jour la donn‚e"

UpdateImageUrl="../RadControls/Grid/Skins/Outlook/Update.Gif" EditText="Modifier la donn‚e"

EditImageUrl="../RadControls/Grid/Skins/Outlook/Edit.Gif">

<HeaderStyle Width="40px" />

<ItemStyle HorizontalAlign="Center" Width="40px"/>

</telerik:GridEditCommandColumn>

<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Supprimer la donn‚e" ConfirmText="D‚sirez-vous supprimer cette donn‚e ?" ConfirmDialogType="RadWindow"

UniqueName="DeleteColumn" ImageUrl="../RadControls/Grid/Skins/Outlook/Delete.Gif">

<HeaderStyle Width="20px" />

<ItemStyle HorizontalAlign="Center" />

</telerik:GridButtonColumn>

<telerik:GridBoundColumn DataField="ID" UniqueName="ID" Visible="false">

</telerik:GridBoundColumn>

</Columns>

<NoRecordsTemplate>

<asp:Label ID="lblNoRecordsTemplate" runat="server" Text="Aucun enregistrement"></asp:Label>

</NoRecordsTemplate>

<ItemStyle Font-Names="Tahoma" Font-Size="8pt" />

</MasterTableView>

</

telerik:RadGrid>

Dynamically I add many columns in my grid in load event of my page. I can click add data button but when i try to save my add, InsertCommand don't fired

why

Shinu
Top achievements
Rank 2
 answered on 19 Jun 2008
1 answer
144 views
How is it possible for one to determine which automatic operation has been selected? I need to differentiate between insert ('Add new record') and edit ('update').
Princy
Top achievements
Rank 2
 answered on 19 Jun 2008
1 answer
93 views

I searched a little bit and didn't find much information. What I would like to do is an insert above or a below an item on the grid. About the only way I can think of doing it would be to have a table which counts the items and the order they're in. Then when you move them around it renumbers the rows in the table and does a refresh on the grid.

Then I'm pulling the information from the SQL database and putting it on a report with Telerik Reporting. So in the Report I could do just do a join and tell the SQL to order by ascending order.

Thanks,

Brett

Princy
Top achievements
Rank 2
 answered on 19 Jun 2008
5 answers
119 views
I am trying to get some cell data from a grid that is bound to an ObjectDataSource.

In the ItemCommand event, when the CommandName is RowClick, I am trying to access e.Item.OwnerTableView.DataKeyValues but there are no columns on the OwenerTableView and no values in DataKeyValues.

It really seems to me like the Telerik controls, great as they are, are not very well made for some scenarios - ie ObjectDataSource.

Thanks
Shinu
Top achievements
Rank 2
 answered on 19 Jun 2008
2 answers
155 views
I've a master table and 2 details table in my grid. In one of the detailtables, I want to disable the expand grid option(not show the details table) based on the value of grid bound column. In the following, when the detailtable questions is binded, I want to check the value of  the column "Type", if it's text box, I want to disable the expand column button. Could someone tell me how to do this?

<DetailTables>
<telerik:GridTableView DataKeyNames="QuestionID" Name="Questions" CommandItemDisplay="Top" Width="100%">
<Columns>
<telerik:GridBoundColumn DataField="QuestionID" HeaderText="ID" UniqueName="QuestionID" Display="false" ReadOnly="true" />
<telerik:GridBoundColumn DataField="Type" HeaderText="Type" UniqueName="Type" />
</Columns>
</telerik:GridTableView>
</DetailTables>
Shinu
Top achievements
Rank 2
 answered on 19 Jun 2008
1 answer
82 views
Is this possible?
For example:  A 4-tier hierarchy of Customers->Sites->Orders->Products.
There is an order under Site A for Customer ABC that needs to be moved to Site B for Customer ABC.

The current set up I have allows me to edit the Site ID from the Order table, but when I click the Update link for editing, no change is made.
Princy
Top achievements
Rank 2
 answered on 19 Jun 2008
7 answers
302 views
I'm adding a programatically created grid to a place holder - is it possible to export this grid (as a PDF or excel sheet)? Nothing I try seems to work, I've also tried recreating the grid and exporting that on a button click but I get an error stating 'RadGrid must be databound before exporting'.
Josh
Top achievements
Rank 1
 answered on 19 Jun 2008
2 answers
163 views
HI:
I have 3 RadGrids in a webform  to be refresh at the same time,and I Rebind they at the same function, but some one work( the AjaxRequest Handler) and the others do nothing at all. 

function

ShowMARC()

{

try

{

grdDetail.AjaxRequest(

"<%= grdDetail.UniqueID %>", "YES");

}

catch(x)

{

alert(x);

}

}




protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string text)

{

base.RaisePostBackEvent(sourceControl, text);

bool showmarc = false;

if (SQL.ToString(text) == "")

showmarc =

SQL.ToBoolean(Session[WebConstant.Web_Global_ShowMARC]);

if (text == "YES")

showmarc =

true;

else if(text == "NO")

showmarc =

false;

int Itemid = SQL.ToInt(Session[WebConstant.Web_Global_ItemidForDetail]);

Session[

WebConstant.Web_Global_ShowMARC] = showmarc;

GridsDataBind(Itemid, showmarc);

}





protected void GridsDataBind(int intItemID, bool showmarc)

{

grdDetail.DataSource =

null;

grdDetail.Rebind();

grdDetail.DataSource = ShowMarc(showmarc);

grdDetail.Rebind();

 

string strSQLTmp = @" Select t03Identifier, t09LibraryName, t09NickName, t03Location,

t03CallNo as t03CallNo, t03CallNoNormalized, t03CopyBarcode, t03Status, t03DueDate,

Case When t03issueidentifier <= 0 Then t03Volume Else Case

When t72VolumeNo IS NOT NULL AND LTRIM(t72VolumeNo) <> '' Then 'Vol. ' + t72VolumeNo Else '' End +

ISNULL(' Iss. ' + t72IssueNo, '') + ' ' + CONVERT(nvarchar(10), t72MagazineDate, 20) End

As t03Volume, t03issueidentifier , t04FirstName + ' ' + t04LastName CheckoutBy From Copies_t03,libraries_t09,Issue_t72,Patrons_t04

Where t03CheckoutBy *= t04Key And t03IssueIdentifier *= t72Identifier And t09LibraryId = t03LibraryID and t03ItemIdentifier = "

+ intItemID;

string Libraries = "'" + (SQL.ToString(Session[WebConstant.Web_Global_LibraryID])).Replace(",", "','") + "'";

if ((Libraries.EndsWith("'0'")))

{

strSQLTmp = strSQLTmp +

" and t03LibraryID in (" + Libraries + ")";

}

strSQLTmp = strSQLTmp +

@"Order by

ISNULL(Replicate(' ',10-len(ISNULL(t72VolumeNo,''))),'') + ISNULL(t72VolumeNo,''), ISNULL(Replicate('

',10-len(ISNULL(t72IssueNo,''))),'') + ISNULL(t72IssueNo,''), t03Volume "

;

DataTable dt = SQL.ExecuteSQL_fill(strSQLTmp);

grdCopyInformation.DataSource =

null;

grdCopyInformation.Rebind();

grdCopyInformation.DataSource = dt;

grdCopyInformation.Rebind();

Session[

WebConstant.Web_Global_Iteminfomation] = dt;

string PatronKey = (string)Session[WebConstant.Web_Global_PatronKey];

string Sqlstr = @"Select t65ItemIdentifier, t65FileTitle as Title, t65FileType

as FileType, t65AttachFileName as Location, ISNULL(t65CoverImage,0)

t65CoverImage from ItemAttach_t65 where t65ItemIdentifier="

+ intItemID;

dt =

SQL.ExecuteSQL_fill(Sqlstr);

grdMultimedia.DataSource =

null;

grdMultimedia.Rebind();

grdMultimedia.DataSource = dt;

grdMultimedia.Rebind();

Session[

WebConstant.Web_Global_ItemMultimedia] = dt;

}

Jack
Top achievements
Rank 1
 answered on 19 Jun 2008
4 answers
547 views
Getting this error whenever accessing the grid, this is basically the code, I get an error on both enumerations... I've alse tried using e. DestinationGrid instead of this.radGrid...

protected void radGrid_RowDrop(object sender, GridDragDropEventArgs e)
{
    foreach(GridDataItem gridItem in this.radGrid.MasterTableView.Items)
    {
        //do stuff...
    }

foreach (GridDataItem draggedItem in e.DraggedItems)
    {
           //do stuff
    }

}


 Edit - this grid is in a radajax panel if it makes any difference -

Josh
Top achievements
Rank 1
 answered on 19 Jun 2008
5 answers
305 views
Hi. I am saving an appointment with recurrence in my database. The field has the following value:

DTSTART:20080609T120000Z
DTEND:20080609T180000Z
RRULE:FREQ=WEEKLY;UNTIL=20081231T040000Z;INTERVAL=1;BYDAY=MO

And when i load the appointments my method return a List of CalendarioMedicoList that it is a subclass of Appointment. My code is
For Each rowData In ds.Tables(0).Rows 
   cm = New CalendarioMedico() 
 
   cm.ID = rowData("IdeSeq") 
   Dim s As String = rowData("FECINI").ToString().Substring(0, 10) + " " + rowData("HORAINI").ToString() 
   cm.StartTime = DateTime.Parse(rowData("FECINI").ToString().Substring(0, 10) + " " + rowData("HORAINI").ToString()) 
   cm.EndTime = DateTime.Parse(rowData("FECFIN").ToString().Substring(0, 10) + " " + rowData("HORAFIN").ToString()) 
   cm.RecurrenceRule = rowData("RECURRENCERULE").ToString() 
 
  cm.CodPais = rowData("CODPAIS").ToString() 
  cm.CodCia = rowData("CODCIA").ToString() 
  cm.CodOfi = rowData("CODOFI").ToString() 
  cm.CodId = rowData("CODID").ToString() 
  cm.NumId = rowData("NUMID").ToString() 
 
  If rowData("INDTIPOHORARIO").ToString() = "01" Then 
    cm.TipoInfo = CalendarioMedico.TipoInfoCalendario.Especialidad 
    cm.Subject = rowData("NOMESPECIALIDAD").ToString() 
    cm.IdeEspecialidad = rowData("IDEESPECIALIDAD") 
  Else 
    cm.TipoInfo = CalendarioMedico.TipoInfoCalendario.NoDisponible 
    cm.Subject = "Feriado:" + rowData("DESMOTIVO").ToString() 
    cm.IdeEspecialidad = rowData("CODMOTIVO") 
  End If 
 lista.Add(cm) 
 

Note that I do cm.RecurrenceRule = recurrence string from my table, however when I saw the RadScheduler I don't get any recurrence dates and there is no visual clue on my starting date that it is recurrence.

Any clue ?

Yamil
Top achievements
Rank 1
 answered on 18 Jun 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?