tag:blogger.com,1999:blog-4126985520350746834.post6706228498278964031..comments2024-03-28T07:00:21.554+00:00Comments on Chris O'Brien: SPDataSource - every developer's friend (part 2)Chris O'Brienhttp://www.blogger.com/profile/10022906552670607366noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-4126985520350746834.post-63478019891548792832013-09-06T11:42:15.555+01:002013-09-06T11:42:15.555+01:00Hi Chris,
Thanks for the amazing blog. I learn a l...Hi Chris,<br />Thanks for the amazing blog. I learn a lot from it.<br />One question: have you ever used a managed metadata column in SPDataSource?<br />In my case, I bind my SPGridView with SPDataSource but in filtering it is giving me "TermName|TermGUID". Could you help?Garimahttps://www.blogger.com/profile/13580548658140990071noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-57736920475607336542013-07-11T09:59:30.796+01:002013-07-11T09:59:30.796+01:00Thank You for being one of the very few to provide...Thank You for being one of the very few to provide any guidance on SPDataSource filtering with parameters... other blogs on it are not 'findable'... Thanks for great work again!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-9915982199431716132013-01-18T19:32:08.312+00:002013-01-18T19:32:08.312+00:00Excellent article. How would you filter the data b...Excellent article. How would you filter the data based on input from a textbox instead of a dropdown? I am looking for a solution which using filter-as-you-type to filter my SPDataSource and asp:GridView targeting a specific column.<br /><br />Thanks.<br />Anonymoushttps://www.blogger.com/profile/06164709434864097001noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-30427323093124070502010-10-08T01:10:29.537+01:002010-10-08T01:10:29.537+01:00Thanks for posting this insight into binding SPDat...Thanks for posting this insight into binding SPDatasources to controls. This has big wins for users that only have Designer available.<br /><br />Cheers,<br />MattAnonymoushttps://www.blogger.com/profile/03288345375198893987noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-34943352890177151442009-11-16T14:09:08.673+00:002009-11-16T14:09:08.673+00:00Hey Alan,
I'm not sure you can return just th...Hey Alan,<br /><br />I'm not sure you can return just the ID of a lookup field in the select portion of an SPDataSource. By definition, you are requesting the field, regardless of type.<br /><br />In case you don't know, you can use an SPQuery to query your SharePoint list, get the SPListItemCollection using SPList.GetItems(SPQuery) and then assign a SPFieldLookupValue to your lookup field. From there, you would use SPFieldLookupValue.LookupID to get the ID of your lookup field.<br /><br />I'm still learning SharePoint so there might be a better way, but this is what worked for me.<br /><br />HTH,<br /><br />KeithKeith Oswalthttps://www.blogger.com/profile/03068174919334550778noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-81212629354429540832009-11-13T18:04:54.649+00:002009-11-13T18:04:54.649+00:00@Alan,
Not sure I'm afraid, I don't think...@Alan,<br /><br />Not sure I'm afraid, I don't think I've used SPDataSource with lookup fields.<br /><br />Best of luck..<br /><br />Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-39012716392659257302009-11-13T14:44:32.541+00:002009-11-13T14:44:32.541+00:00Hi Chris,
How would you return the ID part of a L...Hi Chris,<br /><br />How would you return the ID part of a Lookup Field using an SPDataSource.<br /><br />I've tried using <br /><br /><ViewFields><br /><FieldRef LookupId='TRUE' name='MyField1 /><br /></ViewFields><br /><br />within the selectcommand of the SPDatasource, however the text content of the lookup ID is always returned.Alannoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-82493644947933701142009-07-23T22:52:22.882+01:002009-07-23T22:52:22.882+01:00@Granada,
Sorry, I didn't do much with SPData...@Granada,<br /><br />Sorry, I didn't do much with SPDataSource in cross-list mode. At a guess, it could be because one of the lists involved in the query doesn't contain a column called 'Title'.<br /><br />Best of luck,<br /><br />Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-40403942066987629932009-07-15T21:15:36.575+01:002009-07-15T21:15:36.575+01:00Hi Chris,
I am using the SPDatasource in Crosslist...Hi Chris,<br />I am using the SPDatasource in Crosslist mode to query data from Tasks list and I am binding it to SPGridview. But I do get an error saying "A field or property with the name 'Title' was not found on the selected data source.<br />If I use the SPDatasource in List mode everything works fine.<br />Any help in this regard is greatly appretiated.<br />Thanks,<br />GranadaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-65697533817543111972009-04-13T20:09:00.000+01:002009-04-13T20:09:00.000+01:00Hi Robert,Thanks, but I don't think that was the e...Hi Robert,<BR/><BR/>Thanks, but I don't think that was the execution lifecycle problem I ran into at the time.<BR/><BR/>Appreciate the pointer anyway though :-)<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-20480480263736184412009-04-11T19:55:00.000+01:002009-04-11T19:55:00.000+01:00To get around the control execution lifecycle prob...To get around the control execution lifecycle problem change the EnableViewState behavior to False for the dropdown you're trying to filter. With it set to true you're telling the drop-down to keep its values even when it round-trips.Robert Martineznoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-46395341863618105142009-04-02T21:33:00.000+01:002009-04-02T21:33:00.000+01:00@evilgenius,The code kind of goes where you need i...@evilgenius,<BR/><BR/>The code kind of goes where you need it - for me, it was in a MOSS page layout (WCM) which was hosting my dropdown control. <BR/><BR/>It sounds in your case like you're wanting to use it on a SharePoint list page. In that case yes, I think editing the appropriate form (e.g. newform.aspx) in SharePoint Designer is what you should be doing.<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-68133992360097405682009-04-02T21:21:00.000+01:002009-04-02T21:21:00.000+01:00Where does this code actually go? I understand the...Where does this code actually go? I understand the code, but I do not know what file it goes in. At first I thought it would go in a custom newform.aspx pageAnonymoushttps://www.blogger.com/profile/16549842099150105698noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-81524861889595525262009-03-12T09:31:00.000+00:002009-03-12T09:31:00.000+00:00@Anonymous,Again, I think it's more likely to be a...@Anonymous,<BR/><BR/>Again, I think it's more likely to be a page execution lifecycle thing rather than caching - unless you are doing some form of caching obviously. <BR/><BR/>Unfortunately I can't remember if I had to change anything to re-bind on postback, but the markup above is definitely what I had working. Sorry I can't be more helpful.<BR/><BR/>Cheers,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-67856534486273850382009-03-06T18:22:00.000+00:002009-03-06T18:22:00.000+00:00Hi I'm having the same problem of Richard, it look...Hi I'm having the same problem of Richard, it looks like the ControlParameter get the value the first time the browser load the page but not in the subsequent postback, the code is formerly the same as yours.<BR/>maybe can be any cache of sharepoint?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-24595032989838970042009-03-03T06:01:00.000+00:002009-03-03T06:01:00.000+00:00Hi Richard,I'm afraid I'd need to see what you're ...Hi Richard,<BR/><BR/>I'm afraid I'd need to see what you're doing to try and work out the problem. As I say, I actually got it working fine in the end - it's just I think I initially was trying to do something too late in the cycle.<BR/><BR/>Cheers,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-81788572945808371572009-02-26T17:41:00.000+00:002009-02-26T17:41:00.000+00:00Hi Chris How did you get around teh control execu...Hi Chris <BR/><BR/>How did you get around teh control execution lifecycle problems. I am trying to use the ControlParemeter to render one dropdown from another. Whilst everything seems ok, the second dropdown does not change when the first is changed. Thanks<BR/><BR/>RichardAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-77552323811682786182008-08-17T13:58:00.000+01:002008-08-17T13:58:00.000+01:00Hi Mike,I found these articles on SPDataSource ver...Hi Mike,<BR/>I found these articles on SPDataSource very interesting!<BR/>Kind regards,<BR/>KarineAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-25034127659399686752008-07-31T21:40:00.000+01:002008-07-31T21:40:00.000+01:00Hi Mike,Afraid I've not done too much with SPD wor...Hi Mike,<BR/><BR/>Afraid I've not done too much with SPD workflows so can't really help. Suggest checking some of the posts on the SPD Team blog..<BR/><BR/>Best of luck,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-28074425544667379162008-07-25T00:07:00.000+01:002008-07-25T00:07:00.000+01:00Hi Chris,Thankyou for all your useful blogs.I am n...Hi Chris,<BR/><BR/>Thankyou for all your useful blogs.<BR/><BR/>I am new to SharePoint Designer. I need to create a very simple workflow in designer which should be initiated on adding/updating an item in a list and work something like:<BR/><BR/>1. check column(choice yes/no) value.<BR/><BR/>2. if "yes" then before publishing this item, it should go for approval to approver group.<BR/><BR/>3. approver should be presented with a form with approved, rejected buttons.<BR/><BR/>4. If approver clicks 'approved' button then item will be published with "yes" as value for choice column.<BR/><BR/>5. If rejected then item will be published with "No" as value for the choice column and email the author of this item.<BR/><BR/>Sorry for my bad english!<BR/><BR/>mikeAnonymousnoreply@blogger.com