Hi, I'm using Ultrawebgrid for my applcation:
I'm using a textarea for listing the errors in my application in the RowEditTemplate when the user clicks that particular row...
So I need to have texarea only when there are any errors..... otherwise when there are no errors i dont even want the row_template to pop up..... I'm using IE6.
I'm checking if there are any errors using javascript.so I had to use the javascript event handler::*UltraWebGrid1_BeforeRowTemplateOpenHandler(gridName, rowId, templateId)*
where in I write the statements given below:document.getElementById("TextArea2").style.visibility="collapse" inside the above event function
1) it's showing javascript error as "Couldnot get the visibility property:Invalid Argument" but the row template does not pop up....... only the error's coming....
2) Is there any code to block the row template when there are no errors.?? i mean no pop_up for no errors
3) I need the error messages to be visible in the text area only when the particular row is selected... otherwise when clicks/selections happen in any other place,errors shod disappear........
Can u provide some code snippets???????
Hi,
Is your error stored in any of the grid’s column for all the rows seperately?
If yes then you can manage it in BeforeRowTemplateOpenHandler event handler only in following way.
function UltraWebGrid1_BeforeRowTemplateOpenHandler(gridName, rowId, templateId)
{
var row = igtbl_getRowById(rowId);
var errorColumnKey = "ErrorCol" ;//Columnname of your error column
var errorValue = row.getCellFromKey(errorColumnKey).getValue();
var txtArea = document.getElementById("<%= TextArea2.ClientID %>");
if (errorValue != null)
txtArea.innerHTML = errorValue;
txtArea.style.display = "block";
}
else
txtArea.innerHTML = "";
txtArea.style.display = "none";
Otherwise please provide more information about where are you storing errors.
Let me know if this works for you.
Regards,
HBA
Thank u very much Bob...... U really helped me at this urgent time........
I still need ur help (as specifiesd in point 3 in the above post).....
After the error is displayed in the textarea.... now If i click somewhere (say a button) other than the row in the grid, the error should go off....
I mean only and only when the (errored)row is clicked, the errors should be displayed in the textarea when we click somewhere else the errors displayed should go off and textarea shouldn't appear!!!!
Can u help me with this too????
Hello,
It seems that you want to open the edit template only on specific condition.
You can achieve this simply by returning true from the BeforeRowTemplateOpenHandler event handler on your conditions. You can handle this in event in following way.
var isError = isErrorOccured(); //Identify you error condtion here
if(!isError)
return true;
Above code will not open pop up at all.
Remember that you can use return true to cancel any Infragistics client side event.
Further to that, are you sure that is document.getElementById("TextArea2") returning an object? Otherwise you can try document.getElementById("<%= TextArea2.ClientID %>") as follow.
document.getElementById("<%= TextArea2.ClientID %>").style.display = "none";
Please let me know if this helps you.
Can sum1 reply to this? URGENT....