I'm migrating a UltraWebGrid to webdatagrid v11.2 but I can not get the igtbl_getCellById of a cell of a webdatagrid infragistics v11. and link it to a similar reference is disabled help please
function ClickBTabla(gridName, cellId){
var cell = igtbl_getCellById(cellId); //aqui genera el error (Microsoft JScript runtime error: Object expected) var renglon = igtbl_getRowById(cellId);
switch(cell.Column.Key)
{
}
//mostrar otro formulario
Hello,
in the new WebDataGrid the following methods are available to use:
var gridRow = ig_controls.WebDataGrid1.get_rows().get_row(0);
var rowCell = gridRow.get_cell(2) // pass the index of the cell
var rowCell = gridRow.get_cellByColumnKey("Date") // pass the column key as string
var rowCell = gridRow.get_cell(column) // pass a grid's column object
Thank you very much for the prompt reply Hristo Araises the following question I hope you can help me thank you very much in advance
My code is as follows
it is a User Control and my board if loading data
<ig:WebDataGrid ID="TablaGrid" runat="server" Height="350px" Width="400px" HeaderCaptionCssClass="Header" AutoGenerateColumns="False"> <Behaviors> <ig:EditingCore AutoCRUD="false"><Behaviors><ig:RowAdding Enabled="false" AddNewRowCssClass="stylenewbox" /></Behaviors></ig:EditingCore></Behaviors><Behaviors><ig:Paging PagerMode="NumericFirstLast" PageSize="1000000000"></ig:Paging></Behaviors> <ClientEvents Click="ClickBTabla" DoubleClick="TablaGrid_DblClickHandler" /> </ig:WebDataGrid>
the columns to be loaded are specified from the server side.
the question is whether the<ClientEvents Click = "ClickBTabla" DoubleClick = "TablaGrid_DblClickHandler" />
in automatic corresponding values are sent to my function as probe you sent me in response and my value is null. or do I need to specify which columns should show from design. or that's what I need. not that I'm doing wrong my function remains the same
ClickBTabla function (gridname, cellid){
// add here that you sent me in a reply
switch (cell.Column.Key)
{}// show another form}
Hello Mary,
Please provide a working sample project replicating your issue, so we can take a look at it.Thank you in advance!
Hello Denis Georgiev
I attached the file with the code and a brief explanation on what my goal I agracesco advance your help
I hope it is understandable, otherwise let me know how your doubts
Please attach the sample as isolated Visual Studio project, focusing only on the issue.
Thank you in advance.
I attached the project in Visual Studio.
And these are the data contained in the table in the database and stored procedure
************************************************************
Name Table Horarios
IdHorario Nombre Descripcion FechaElaboracion Activo
2 Morning Monday and Friday 2015-03-03 1 3 Weekend Friday and Saturday 2015-03-03 1 4 Evening Monday and Thursday 2015-03-03 1
********************************************************************************
my store procedure
alter proc consultarhorarios@IdHorario INT = NULL
AS SELECT * FROM Horarios WHERE (@IdHorario IS NULL OR @IdHorario = @IdHorario)
Reiterate my problem is in my function ClickBTablate
I thank you in advance and I am waiting for your questions and your comments
The function that executes on Click event takes two arguments : sender, which returns the grid object and eventArgs. I hope this helps if this is what you are asking for. However I am note sure I got your issue correctly, so please explain in more details what is your issue, I will be glad to help.
Hi Hristo AMy problem ... as such I want to get id, the key and so on the clickeada or selected cell (I hope I'm using the term correctly) that in order to send in another WebForm detail of that Schedule.It is noteworthy that previously UltraWebGrid v5 could get those data with this Function "ClickBTabla" also take into account that it uses ig_webgrid.js, ig_shared and ig_webgrid_domI appreciate your kind attention and hope to see been explicit.
And sorry for the inconvenience that might cause my question.
Thank you for clarifying. I believe this should work for you:
1) Attach to the click event of the WebDataGrid
<ClientEvents Click="WebDataGrid1_Grid_Click" />
2) You can get the clicked object ( it may be a cell, or header, footer, etc) from the eventArgs:
function WebDataGrid1_Grid_Click(sender, eventArgs){ var clickedObject = eventArgs.get_item(); var objectType = eventArgs.get_type();}
Please let me know if you have further questions on the matter.
Hello Hristo A
Thank you very much your code very well explainedbut I can not get only the Key to save my variable since it eg with Webdatamenu I get it so ...
var mykey = eventArgs.getItem () get_key ().;
using and crossing data clickedObject of the function that you recommended me to use if I can visualize this key but not how to remove ...Also similarly would get the getCellFromKey of eventArgs and get.value
I appreciate your kind attention and again apologize for any inconvenience this may generarte
Hello Garcia,
I am not sure what key you need to get. eventArgs.get_item() returns a cell, which does not has a key property. However this cell belongs to a column and you can get the column key like this:
var mykey = eventArgs.get_item().get_column().get_key();
Please let me know if this is what you need if I have misunderstood you.