Hi ,
I am following this thread.
http://community.infragistics.com/forums/p/66178/359778.aspx#359778
The code in this link is working fine with normal XamGrid columns. With Templated column its not working.
I also want to disable loast focus functionality and want to add row only on enter hit and cancel on escape. But my grid contains number of template columns which contains XAMMutilComboBoxEditor, datepicker etc.
One more issue i am facing is , I need to add new row (where user can enter the values to add the new row) in the bottom means end of all the rows. But this new row is coming at the end of the grid. That is if grid width is 500 and it contains only two rows, then the new row should come in the third row not in the ned of the grid. (currently showing some white space between the grid last row and the new row i.e. end of the grid).
And also I am not able to set this new row in editable mode on load. I dont want user to double or single click to enter data in this row. It should always be in editable mode to enter data.
I want to attach a sample code for this. But not able to attach it currently.Save Button in options in this post is not working. I am working in WPF not in silverlight so please help in WPF .
Please help me by providing some WPF sample project with these isue or give some guidance to solve these.
Hello,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
I have modified the sample Krasimir has sent you, so now it works as you want. Basically I handled the XamGrid’s RowAdding event and check if the canAdd is true or false and cancel or not the event. Also I removed the handler for the KeyDown event, so now the null reference exception is no longer thrown when you press escape. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thank you for the reply.
But your solution is not totally correct.Its crashing in several scenarios.Below are the steps to replicate:-
1.) Select a date in datepicker in the grid and hit enter. It will add the row in the grid , i.e fine.
2.) then again select a date and hit escape key. The solution will crash with null exception.
Second issue is :- its still adding the row in lost focus.
Steps to replicate:-
1.) select a date from date picker and hit enter. It will add the row.
2.) again select an item and click anywhere in the grid. It will again add the new row. It should not add. It should add only on enter key.
But if you again select any date (i.e. third time) , then it will work fine , only on enter clcik it will add new row.
Again on 4th time , it will add on lost focus.
It behaves wrongly only on even times. or after every enter clcik when you select something then on lost focus it will add new row.
Thank you for your post. I have been looking into the issue that you have described and it seems that it is caused by the fact that in the XamMultiColumnComboEditor and the DatePicke also, the KeyDown event is handled when the enter key is pressed, which seems to be done for implementing the control’s functionality. In this scenario, I have suggest handling the PreviewKeyDown event of the controls and there implementing the same logic as in the KeyDown event and also call the ExitEditMode of the XamGrid. This way when the focus in on the XamMultiColumnComboEditor, for example and enter is pressed, the new row will be added.
Regarding you question for setting the AddNewRow in edit mode when the XamGrid is loaded, I can suggest handling the Loaded event of the control and there you can get the current AddNewRow using the RowsManager. When you have the AddNewRow you can call the EnterEditMode method of the XamGrid and pass the AddNewRow as parameter, which will put the row in edit mode. I have created a sample application for you that demonstrates how you can implement this functionality.
Regarding the AddNewRow location, currently the XamGrid supports fix position when the AllowAddNewRow property of the AddNewRowSettings is set to Bottom. Our other WPF grid supports this feature. You can read more detailed information regarding it here in our documentation: http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldLayoutSettings~AddNewRecordLocation.html. I have submitted a new Product Idea for you, for the ability to set the AddNewRow location to the position that you wish. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI12070010
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Please some one reply for this post. I am still not able to handle disable lost focus for adding the row in templated coulmn grid.